syzbot


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

Status: auto-closed as invalid on 2020/02/19 14:26
Reported-by: syzbot+30dcbeb5addae00dca04@syzkaller.appspotmail.com
First crash: 1645d, last: 1645d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: stack-out-of-bounds Read in xfrm_selector_match C 672 1997d 2464d 0/3 closed as invalid on 2018/11/08 02:37
upstream KASAN: stack-out-of-bounds Read in xfrm_selector_match net 368 2294d 2301d 4/26 fixed on 2018/02/13 04:59
upstream KASAN: stack-out-of-bounds Read in xfrm_selector_match (2) net 1 1312d 1310d 15/26 fixed on 2020/11/16 12:12
android-44 KASAN: stack-out-of-bounds Read in xfrm_selector_match C 36 2007d 1840d 0/2 public: reported C repro on 2019/04/11 08:44
android-49 KASAN: stack-out-of-bounds Read in xfrm_selector_match (2) C 13 1643d 1838d 0/3 public: reported C repro on 2019/04/13 00:00

Sample crash report:
==================================================================
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
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/22 14:25 android-4.14 7d642373db4c c59a7cd8 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.