syzbot


WARNING: refcount bug in xfrm_policy_bysel_ctx

Status: fixed on 2019/03/06 07:43
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+8a6a21b4254f25f2ee66@syzkaller.appspotmail.com
Fix commit: 12750abad517 xfrm: policy: fix infinite loop when merging src-nodes
First crash: 1925d, last: 1925d
Discussions (1)
Title Replies (including bot) Last reply
WARNING: refcount bug in xfrm_policy_bysel_ctx 0 (1) 2019/01/11 15:57

Sample crash report:
netlink: 104 bytes leftover after parsing attributes in process `syz-executor4'.
netlink: 104 bytes leftover after parsing attributes in process `syz-executor4'.
------------[ cut here ]------------
refcount_t: increment on 0; use-after-free.
WARNING: CPU: 0 PID: 25457 at lib/refcount.c:153 refcount_inc_checked lib/refcount.c:153 [inline]
WARNING: CPU: 0 PID: 25457 at lib/refcount.c:153 refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 25457 Comm: syz-executor4 Not tainted 4.20.0+ #16
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1db/0x2d0 lib/dump_stack.c:113
 panic+0x2cb/0x589 kernel/panic.c:189
 __warn.cold+0x20/0x4b kernel/panic.c:544
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 fixup_bug arch/x86/kernel/traps.c:173 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:290
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Code: 1d 8a 37 c8 06 31 ff 89 de e8 1b 27 f2 fd 84 db 75 dd e8 d2 25 f2 fd 48 c7 c7 e0 97 81 88 c6 05 6a 37 c8 06 01 e8 0f 7d bb fd <0f> 0b eb c1 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54 49
RSP: 0018:ffff88806d877138 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc9000bf9d000
RDX: 000000000001d827 RSI: ffffffff816849b6 RDI: 0000000000000005
RBP: ffff88806d877148 R08: ffff8880608260c0 R09: ffff888060826988
R10: ffff8880608260c0 R11: 0000000000000000 R12: ffff88806a024520
R13: ffff888087287c00 R14: ffff88806d8772d0 R15: 0000000000000004
 xfrm_pol_hold include/net/xfrm.h:838 [inline]
 xfrm_policy_bysel_ctx+0x1c9/0x1020 net/xfrm/xfrm_policy.c:1679
 xfrm_get_policy+0x67b/0x1160 net/xfrm/xfrm_user.c:1887
 xfrm_user_rcv_msg+0x458/0x8d0 net/xfrm/xfrm_user.c:2663
 netlink_rcv_skb+0x17d/0x410 net/netlink/af_netlink.c:2477
 xfrm_netlink_rcv+0x70/0x90 net/xfrm/xfrm_user.c:2671
 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
 netlink_unicast+0x574/0x770 net/netlink/af_netlink.c:1336
 netlink_sendmsg+0xa05/0xf90 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:621 [inline]
 sock_sendmsg+0xdd/0x130 net/socket.c:631
 ___sys_sendmsg+0x7ec/0x910 net/socket.c:2116
 __sys_sendmsg+0x112/0x270 net/socket.c:2154
 __do_sys_sendmsg net/socket.c:2163 [inline]
 __se_sys_sendmsg net/socket.c:2161 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161
 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457ec9
Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f6d47b19c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9
RDX: 0000000000000000 RSI: 000000002014f000 RDI: 0000000000000006
RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6d47b1a6d4
R13: 00000000004c5394 R14: 00000000004d8e30 R15: 00000000ffffffff
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/01/11 12:47 net-old b19bce0335e2 80dde172 .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.