KASAN: stack-out-of-bounds Read in xfrm_state_find (2)

7 views
Skip to first unread message

syzbot

unread,
Apr 11, 2019, 4:44:45 AM4/11/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 9f23a833 Merge 4.9.148 into android-4.9
git tree: android-4.9
console output: https://syzkaller.appspot.com/x/log.txt?x=13bdc120c00000
kernel config: https://syzkaller.appspot.com/x/.config?x=55dc746adbeac1dd
dashboard link: https://syzkaller.appspot.com/bug?extid=d53b6a6b04837f514a88
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=160eedfd400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1191301d400000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+d53b6a...@syzkaller.appspotmail.com

random: crng init done
==================================================================
BUG: KASAN: stack-out-of-bounds in __xfrm6_daddr_saddr_hash
net/xfrm/xfrm_hash.h:28 [inline]
BUG: KASAN: stack-out-of-bounds in __xfrm_dst_hash net/xfrm/xfrm_hash.h:95
[inline]
BUG: KASAN: stack-out-of-bounds in xfrm_dst_hash net/xfrm/xfrm_state.c:60
[inline]
BUG: KASAN: stack-out-of-bounds in xfrm_state_find+0x26a0/0x2910
net/xfrm/xfrm_state.c:807
Read of size 4 at addr ffff8801cd59f6b0 by task syz-executor824/2054

CPU: 0 PID: 2054 Comm: syz-executor824 Not tainted 4.9.148+ #1
ffff8801cd59ee60 ffffffff81b44d01 0000000000000000 ffffea00073567c0
ffff8801cd59f6b0 0000000000000004 ffffffff82653050 ffff8801cd59ee98
ffffffff815020d5 0000000000000000 ffff8801cd59f6b0 ffff8801cd59f6b0
Call Trace:
[<ffffffff81b44d01>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffffff81b44d01>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
[<ffffffff815020d5>] print_address_description+0x6f/0x238
mm/kasan/report.c:256
[<ffffffff8150232a>] kasan_report_error mm/kasan/report.c:355 [inline]
[<ffffffff8150232a>] kasan_report mm/kasan/report.c:412 [inline]
[<ffffffff8150232a>] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397
[<ffffffff814f4504>] __asan_report_load4_noabort+0x14/0x20
mm/kasan/report.c:432
[<ffffffff82653050>] __xfrm6_daddr_saddr_hash net/xfrm/xfrm_hash.h:28
[inline]
[<ffffffff82653050>] __xfrm_dst_hash net/xfrm/xfrm_hash.h:95 [inline]
[<ffffffff82653050>] xfrm_dst_hash net/xfrm/xfrm_state.c:60 [inline]
[<ffffffff82653050>] xfrm_state_find+0x26a0/0x2910
net/xfrm/xfrm_state.c:807
[<ffffffff82638ad7>] xfrm_tmpl_resolve_one+0x1c7/0x7a0
net/xfrm/xfrm_policy.c:1500
[<ffffffff826392c6>] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:1544 [inline]
[<ffffffff826392c6>] xfrm_resolve_and_create_bundle+0x216/0x1eb0
net/xfrm/xfrm_policy.c:1893
[<ffffffff8263c370>] xfrm_lookup+0x200/0xaf0 net/xfrm/xfrm_policy.c:2254
[<ffffffff8263db18>] xfrm_lookup_route+0x38/0x140
net/xfrm/xfrm_policy.c:2379
[<ffffffff82488a23>] ip_route_output_flow+0x93/0xa0 net/ipv4/route.c:2448
[<ffffffff82568ed4>] udp_sendmsg+0x1494/0x1c60 net/ipv4/udp.c:1025
[<ffffffff82704c6f>] udpv6_sendmsg+0x12af/0x2430 net/ipv6/udp.c:1086
[<ffffffff82592192>] inet_sendmsg+0x202/0x4d0 net/ipv4/af_inet.c:770
[<ffffffff822a04ee>] sock_sendmsg_nosec net/socket.c:648 [inline]
[<ffffffff822a04ee>] sock_sendmsg+0xbe/0x110 net/socket.c:658
[<ffffffff822a1ea7>] ___sys_sendmsg+0x387/0x8b0 net/socket.c:1982
[<ffffffff822a5324>] __sys_sendmmsg+0x164/0x3d0 net/socket.c:2072
[<ffffffff822a55c5>] SYSC_sendmmsg net/socket.c:2103 [inline]
[<ffffffff822a55c5>] SyS_sendmmsg+0x35/0x60 net/socket.c:2098
[<ffffffff810056bd>] do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285
[<ffffffff82812993>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

The buggy address belongs to the page:
page:ffffea00073567c0 count:0 mapcount:0 mapping: (null) index:0x1
flags: 0x4000000000000000()
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801cd59f580: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
ffff8801cd59f600: f1 00 00 00 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00
> ffff8801cd59f680: 00 00 00 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 00
^
ffff8801cd59f700: 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00
ffff8801cd59f780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages