syzbot


INFO: trying to register non-static key in rhashtable_free_and_destroy

Status: fixed on 2021/01/04 20:45
Reported-by: syzbot+4d9ef8a2f5bd3b2bad32@syzkaller.appspotmail.com
Fix commit: 42a387dc80c3 mac80211: mesh: fix mesh_pathtbl_init() error path
First crash: 1254d, last: 1240d
Fix bisection: fixed by (bisect log) :
commit 42a387dc80c334ad78e604e0522b3d7a3f7113a5
Author: Eric Dumazet <edumazet@google.com>
Date: Fri Dec 4 16:24:28 2020 +0000

  mac80211: mesh: fix mesh_pathtbl_init() error path

  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 INFO: trying to register non-static key in rhashtable_free_and_destroy (2) 1 1193d 1193d 0/1 auto-closed as invalid on 2021/05/18 21:48

Sample crash report:
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004418c9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffea8b688e0 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 7986 Comm: syz-executor074 Not tainted 4.14.207-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 register_lock_class+0x32b/0x1320 kernel/locking/lockdep.c:768
 __lock_acquire+0x167/0x3f20 kernel/locking/lockdep.c:3378
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 flush_work+0xad/0x770 kernel/workqueue.c:2889
 __cancel_work_timer+0x321/0x460 kernel/workqueue.c:2964
 rhashtable_free_and_destroy+0x26/0x710 lib/rhashtable.c:1073
 mesh_table_free net/mac80211/mesh_pathtbl.c:70 [inline]
 mesh_pathtbl_init+0x223/0x290 net/mac80211/mesh_pathtbl.c:863
 ieee80211_mesh_init_sdata+0x2b4/0x650 net/mac80211/mesh.c:1459
 ieee80211_setup_sdata+0xb29/0xf40 net/mac80211/iface.c:1476
 ieee80211_if_add+0xce0/0x16b0 net/mac80211/iface.c:1885
 ieee80211_add_iface+0x89/0x110 net/mac80211/cfg.c:124
 rdev_add_virtual_intf net/wireless/rdev-ops.h:45 [inline]
 nl80211_new_interface+0x44b/0x1360 net/wireless/nl80211.c:2990
 genl_family_rcv_msg+0x572/0xb20 net/netlink/genetlink.c:600
 genl_rcv_msg+0xaf/0x140 net/netlink/genetlink.c:625
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4418c9
RSP: 002b:00007ffea8b688c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004418c9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffea8b688e0 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: global-out-of-bounds in bucket_table_free+0x142/0x150 lib/rhashtable.c:143
Read of size 8 at addr ffffffff8b2de778 by task syz-executor074/7986

CPU: 0 PID: 7986 Comm: syz-executor074 Not tainted 4.14.207-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x5/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 bucket_table_free+0x142/0x150 lib/rhashtable.c:143
 rhashtable_free_and_destroy+0x20a/0x710 lib/rhashtable.c:1093
 mesh_table_free net/mac80211/mesh_pathtbl.c:70 [inline]
 mesh_pathtbl_init+0x223/0x290 net/mac80211/mesh_pathtbl.c:863
 ieee80211_mesh_init_sdata+0x2b4/0x650 net/mac80211/mesh.c:1459
 ieee80211_setup_sdata+0xb29/0xf40 net/mac80211/iface.c:1476
 ieee80211_if_add+0xce0/0x16b0 net/mac80211/iface.c:1885
 ieee80211_add_iface+0x89/0x110 net/mac80211/cfg.c:124
 rdev_add_virtual_intf net/wireless/rdev-ops.h:45 [inline]
 nl80211_new_interface+0x44b/0x1360 net/wireless/nl80211.c:2990
 genl_family_rcv_msg+0x572/0xb20 net/netlink/genetlink.c:600
 genl_rcv_msg+0xaf/0x140 net/netlink/genetlink.c:625
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x4418c9
RSP: 002b:00007ffea8b688c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004418c9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffea8b688e0 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
 __key.0+0x18/0x40

Memory state around the buggy address:
 ffffffff8b2de600: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
 ffffffff8b2de680: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
>ffffffff8b2de700: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
                                                                ^
 ffffffff8b2de780: fa fa fa fa 00 fa fa fa fa fa fa fa 00 00 00 00
 ffffffff8b2de800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/19 11:19 linux-4.14.y 8961076ed318 0767f13f .config console log report syz C ci2-linux-4-14
2020/12/02 20:07 linux-4.14.y c196b3a9c83a eff43e99 .config console log report info ci2-linux-4-14
2020/11/22 18:09 linux-4.14.y 0df445b0f0da 0d27f508 .config console log report info ci2-linux-4-14
2020/11/19 07:56 linux-4.14.y 8961076ed318 0767f13f .config console log report info ci2-linux-4-14
* Struck through repros no longer work on HEAD.