KASAN: stack-out-of-bounds Read in xfrm_selector_match

7 views
Skip to first unread message

syzbot

unread,
Oct 22, 2019, 11:26:09 AM10/22/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 7d642373 ANDROID: refactor build.config files to remove du..
git tree: android-4.14
console output: https://syzkaller.appspot.com/x/log.txt?x=106c7cdf600000
kernel config: https://syzkaller.appspot.com/x/.config?x=e89a9c3deac950f9
dashboard link: https://syzkaller.appspot.com/bug?extid=30dcbeb5addae00dca04
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

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

==================================================================
BUG: KASAN: stack-out-of-bounds in xfrm_flowi_dport include/net/xfrm.h:941
[inline]
BUG: KASAN: stack-out-of-bounds in __xfrm6_selector_match
net/xfrm/xfrm_policy.c:91 [inline]
BUG: KASAN: stack-out-of-bounds in xfrm_selector_match+0xcf3/0xda0
net/xfrm/xfrm_policy.c:104
Read of size 2 at addr ffff88819931f6e4 by task syz-executor.3/17220

CPU: 0 PID: 17220 Comm: syz-executor.3 Not tainted 4.14.150+ #0
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0xca/0x134 lib/dump_stack.c:53
print_address_description+0x60/0x226 mm/kasan/report.c:187
__kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316
xfrm_flowi_dport include/net/xfrm.h:941 [inline]
__xfrm6_selector_match net/xfrm/xfrm_policy.c:91 [inline]
xfrm_selector_match+0xcf3/0xda0 net/xfrm/xfrm_policy.c:104
xfrm_state_look_at.constprop.0+0x237/0x330 net/xfrm/xfrm_state.c:910
xfrm_state_find+0xf5a/0x25a0 net/xfrm/xfrm_state.c:980
xfrm_tmpl_resolve_one+0x1b5/0x7d0 net/xfrm/xfrm_policy.c:1413
xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:1458 [inline]
xfrm_resolve_and_create_bundle+0x20c/0x2020 net/xfrm/xfrm_policy.c:1755
xfrm_lookup_with_ifid+0x20a/0x1770 net/xfrm/xfrm_policy.c:2078
xfrm_lookup net/xfrm/xfrm_policy.c:2202 [inline]
xfrm_lookup_route+0x36/0x1b0 net/xfrm/xfrm_policy.c:2213
ip_route_output_flow+0x89/0xb0 net/ipv4/route.c:2600
udp_sendmsg+0x13a0/0x1bb0 net/ipv4/udp.c:1025
udpv6_sendmsg+0x12ab/0x2500 net/ipv6/udp.c:1193
inet_sendmsg+0x15b/0x520 net/ipv4/af_inet.c:760
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xb7/0x100 net/socket.c:656
___sys_sendmsg+0x368/0x890 net/socket.c:2062
__sys_sendmmsg+0x13c/0x360 net/socket.c:2152
SYSC_sendmmsg net/socket.c:2183 [inline]
SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x459cd9
RSP: 002b:00007fd25d555c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459cd9
RDX: 00000000000005c3 RSI: 0000000020000240 RDI: 0000000000000006
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd25d5566d4
R13: 00000000004c7738 R14: 00000000004dd568 R15: 00000000ffffffff

The buggy address belongs to the page:
page:ffffea000664c7c0 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x4000000000000000()
raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 dead000000000200 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88819931f580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88819931f600: 00 f1 f1 f1 f1 00 00 00 f2 f2 f2 00 00 00 00 f2
> ffff88819931f680: f2 f2 f2 00 00 00 00 00 00 00 f2 f2 f2 f2 f2 00
^
ffff88819931f700: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 00 00 00
ffff88819931f780: 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

unread,
Feb 19, 2020, 9:26:08 AM2/19/20
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages