syzbot


INFO: trying to register non-static key in rhashtable_walk_enter

Status: fixed on 2019/06/18 17:49
Subsystems: tipc
[Documentation on labels]
Reported-by: syzbot+1e8114b61079bfe9cbc5@syzkaller.appspotmail.com
Fix commit: 526f5b851a96 tipc: fix modprobe tipc failed after switch order of device registration
First crash: 1967d, last: 1962d
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 4.9 00/83] 4.9.181-stable review 93 (93) 2019/07/31 15:14
[PATCH 4.4 000/241] 4.4.181-stable review 250 (250) 2019/06/11 18:35
[PATCH 4.14 00/69] 4.14.124-stable review 83 (83) 2019/06/09 07:14
[PATCH 4.19 00/32] 4.19.48-stable review 42 (42) 2019/06/04 09:55
[PATCH 5.1 00/40] 5.1.7-stable review 51 (51) 2019/06/04 05:51
[PATCH 5.0 00/36] 5.0.21-stable review 41 (41) 2019/06/03 23:32
INFO: trying to register non-static key in rhashtable_walk_enter 4 (6) 2019/05/20 22:59
[PATCH v4] tipc: fix modprobe tipc failed after switch order of device registration 3 (3) 2019/05/20 17:49
[PATCH v3] tipc: fix modprobe tipc failed after switch order of device registration 3 (3) 2019/05/20 02:43

Sample crash report:
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 8959 Comm: syz-executor457 Not tainted 5.2.0-rc1+ #1
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+0x172/0x1f0 lib/dump_stack.c:113
 assign_lock_key kernel/locking/lockdep.c:774 [inline]
 register_lock_class+0x167e/0x1860 kernel/locking/lockdep.c:1083
 __lock_acquire+0x116/0x5490 kernel/locking/lockdep.c:3673
 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4302
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:338 [inline]
 rhashtable_walk_enter+0xf9/0x390 lib/rhashtable.c:669
 __tipc_dump_start+0x1fa/0x3c0 net/tipc/socket.c:3414
 tipc_dump_start+0x70/0x90 net/tipc/socket.c:3396
 __netlink_dump_start+0x4f8/0x7d0 net/netlink/af_netlink.c:2351
 netlink_dump_start include/linux/netlink.h:226 [inline]
 tipc_sock_diag_handler_dump+0x1d9/0x270 net/tipc/diag.c:91
 __sock_diag_cmd net/core/sock_diag.c:232 [inline]
 sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:263
 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2486
 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:671
 ___sys_sendmsg+0x803/0x920 net/socket.c:2292
 __sys_sendmsg+0x105/0x1d0 net/socket.c:2330
 __do_sys_sendmsg net/socket.c:2339 [inline]
 __se_sys_sendmsg net/socket.c:2337 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2337
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440209
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffddb5f8388 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440209
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401a90
R13: 0000000000401b20 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: slab-out-of-bounds in debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
BUG: KASAN: slab-out-of-bounds in do_raw_spin_lock+0x28a/0x2e0 kernel/locking/spinlock_debug.c:112
Read of size 4 at addr ffff88809ac8172c by task syz-executor457/8959

CPU: 1 PID: 8959 Comm: syz-executor457 Not tainted 5.2.0-rc1+ #1
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+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
 debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
 do_raw_spin_lock+0x28a/0x2e0 kernel/locking/spinlock_debug.c:112
 __raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline]
 _raw_spin_lock+0x37/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:338 [inline]
 rhashtable_walk_enter+0xf9/0x390 lib/rhashtable.c:669
 __tipc_dump_start+0x1fa/0x3c0 net/tipc/socket.c:3414
 tipc_dump_start+0x70/0x90 net/tipc/socket.c:3396
 __netlink_dump_start+0x4f8/0x7d0 net/netlink/af_netlink.c:2351
 netlink_dump_start include/linux/netlink.h:226 [inline]
 tipc_sock_diag_handler_dump+0x1d9/0x270 net/tipc/diag.c:91
 __sock_diag_cmd net/core/sock_diag.c:232 [inline]
 sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:263
 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2486
 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:671
 ___sys_sendmsg+0x803/0x920 net/socket.c:2292
 __sys_sendmsg+0x105/0x1d0 net/socket.c:2330
 __do_sys_sendmsg net/socket.c:2339 [inline]
 __se_sys_sendmsg net/socket.c:2337 [inline]
 __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2337
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440209
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffddb5f8388 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440209
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401a90
R13: 0000000000401b20 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 1:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 __do_kmalloc_node mm/slab.c:3620 [inline]
 __kmalloc_node+0x4e/0x70 mm/slab.c:3627
 kmalloc_node include/linux/slab.h:590 [inline]
 kvmalloc_node+0x68/0x100 mm/util.c:430
 xt_jumpstack_alloc net/netfilter/x_tables.c:1327 [inline]
 xt_replace_table+0x1a2/0x830 net/netfilter/x_tables.c:1366
 xt_register_table+0x2a4/0x5c0 net/netfilter/x_tables.c:1456
 ipt_register_table+0x19e/0x310 net/ipv4/netfilter/ip_tables.c:1779
 iptable_security_table_init.part.0+0x49/0x70 net/ipv4/netfilter/iptable_security.c:62
 iptable_security_table_init net/ipv4/netfilter/iptable_security.c:56 [inline]
 iptable_security_init+0xc8/0x102 net/ipv4/netfilter/iptable_security.c:95
 do_one_initcall+0x107/0x7ba init/main.c:914
 do_initcall_level init/main.c:982 [inline]
 do_initcalls init/main.c:990 [inline]
 do_basic_setup init/main.c:1008 [inline]
 kernel_init_freeable+0x4d4/0x5c3 init/main.c:1168
 kernel_init+0x12/0x1c5 init/main.c:1086
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88809ac81700
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 12 bytes to the right of
 32-byte region [ffff88809ac81700, ffff88809ac81720)
The buggy address belongs to the page:
page:ffffea00026b2040 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff88809ac81fc1
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea0002712488 ffffea0002729648 ffff8880aa4001c0
raw: ffff88809ac81fc1 ffff88809ac81000 000000010000003f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809ac81600: 00 00 00 fc fc fc fc fc 00 00 fc fc fc fc fc fc
 ffff88809ac81680: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc
>ffff88809ac81700: 00 00 fc fc fc fc fc fc 00 00 fc fc fc fc fc fc
                                  ^
 ffff88809ac81780: fb fb fb fb fc fc fc fc 00 00 fc fc fc fc fc fc
 ffff88809ac81800: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================

Crashes (16):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/05/21 04:11 upstream f49aa1de9836 8285069f .config console log report syz C ci-upstream-kasan-gce-smack-root
2019/05/21 02:19 upstream f49aa1de9836 8285069f .config console log report syz C ci-upstream-kasan-gce-root
2019/05/20 23:33 upstream f49aa1de9836 8285069f .config console log report syz C ci-upstream-kasan-gce-386
2019/05/20 22:58 upstream f49aa1de9836 8285069f .config console log report syz C ci-upstream-kasan-gce-386
2019/05/20 21:14 upstream f49aa1de9836 8285069f .config console log report ci-upstream-kasan-gce
2019/05/20 20:58 upstream f49aa1de9836 8285069f .config console log report ci-upstream-kasan-gce
2019/05/20 20:35 upstream f49aa1de9836 8285069f .config console log report ci-upstream-kasan-gce-smack-root
2019/05/20 20:12 upstream f49aa1de9836 8285069f .config console log report ci-upstream-kasan-gce-smack-root
2019/05/20 19:18 bpf 6a0a923dfa14 8285069f .config console log report ci-upstream-bpf-kasan-gce
2019/05/20 18:56 bpf 6a0a923dfa14 8285069f .config console log report ci-upstream-bpf-kasan-gce
2019/05/20 18:54 bpf 6a0a923dfa14 8285069f .config console log report ci-upstream-bpf-kasan-gce
2019/05/20 18:47 bpf 6a0a923dfa14 8285069f .config console log report ci-upstream-bpf-kasan-gce
2019/05/19 02:29 net-old 5a35c8ea7c40 5a4461b0 .config console log report ci-upstream-net-this-kasan-gce
2019/05/16 23:36 net-old 510e2ceda031 7fb690f3 .config console log report ci-upstream-net-this-kasan-gce
2019/05/22 03:45 bpf-next f49aa1de9836 13427bd9 .config console log report ci-upstream-bpf-next-kasan-gce
2019/05/20 22:16 net-next-old f49aa1de9836 8285069f .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.