INFO: trying to register non-static key in rhashtable_free_and_destroy

4 views
Skip to first unread message

syzbot

unread,
Nov 19, 2020, 2:57:51 AM11/19/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8961076e Linux 4.14.207
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15b2fce2500000
kernel config: https://syzkaller.appspot.com/x/.config?x=44f5233cc1f5c95d
dashboard link: https://syzkaller.appspot.com/bug?extid=4d9ef8a2f5bd3b2bad32
compiler: gcc (GCC) 10.1.0-syz 20200507

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

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4d9ef8...@syzkaller.appspotmail.com

MTD: Attempt to mount non-MTD device "/dev/loop3"
romfs: VFS: Can't find a romfs filesystem on dev loop3.
print_req_error: I/O error, dev loop2, sector 0
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
EXT4-fs (loop5): Ignoring removed bh option
turning off the locking correctness validator.
CPU: 0 PID: 13624 Comm: syz-executor.0 Not tainted 4.14.207-syzkaller #0
EXT4-fs (loop5): can't mount with journal_checksum, fs mounted w/o journal
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:0x45deb9
RSP: 002b:00007f9bf34dbc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000002ba40 RCX: 000000000045deb9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007f9bf34dbca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000b
R13: 00007ffe0e5ddcdf R14: 00007f9bf34dc9c0 R15: 000000000118bf2c
==================================================================
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-executor.0/13624

CPU: 0 PID: 13624 Comm: syz-executor.0 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:0x45deb9
RSP: 002b:00007f9bf34dbc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000002ba40 RCX: 000000000045deb9
RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007f9bf34dbca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000b
R13: 00007ffe0e5ddcdf R14: 00007f9bf34dc9c0 R15: 000000000118bf2c

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
==================================================================


---
This report 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 issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Nov 19, 2020, 6:20:20 AM11/19/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 8961076e Linux 4.14.207
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=178ba486500000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=172d3cf2500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14af0c7a500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4d9ef8...@syzkaller.appspotmail.com

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
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
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

syzbot

unread,
Jan 1, 2021, 6:08:05 PM1/1/21
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 42a387dc80c334ad78e604e0522b3d7a3f7113a5
Author: Eric Dumazet <edum...@google.com>
Date: Fri Dec 4 16:24:28 2020 +0000

mac80211: mesh: fix mesh_pathtbl_init() error path

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10bccc2b500000
start commit: 8961076e Linux 4.14.207
git tree: linux-4.14.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: mac80211: mesh: fix mesh_pathtbl_init() error path

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages