syzbot


INFO: trying to register non-static key in l2cap_chan_del

Status: auto-closed as invalid on 2021/03/22 10:27
Reported-by: syzbot+206885707c6c6d3e137c@syzkaller.appspotmail.com
First crash: 1266d, last: 1258d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: trying to register non-static key in l2cap_chan_del bluetooth syz inconclusive 73 1148d 1366d 20/26 fixed on 2021/11/10 00:50

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: 0 PID: 13847 Comm: syz-executor.4 Not tainted 4.19.159-syzkaller #0
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+0x1fc/0x2fe lib/dump_stack.c:118
 assign_lock_key kernel/locking/lockdep.c:727 [inline]
 register_lock_class+0xe76/0x11c0 kernel/locking/lockdep.c:753
 __lock_acquire+0x17d/0x3ff0 kernel/locking/lockdep.c:3303
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168
 spin_lock_bh include/linux/spinlock.h:334 [inline]
 lock_sock_nested+0x3b/0x110 net/core/sock.c:2864
 l2cap_sock_teardown_cb+0xa0/0x6d0 net/bluetooth/l2cap_sock.c:1340
 l2cap_chan_del+0xbc/0xa50 net/bluetooth/l2cap_core.c:599
 l2cap_conn_del+0x3a6/0x6e0 net/bluetooth/l2cap_core.c:1729
 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7441 [inline]
 l2cap_disconn_cfm+0x98/0xd0 net/bluetooth/l2cap_core.c:7434
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1261 [inline]
 hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1512
 hci_dev_do_close+0x659/0xf10 net/bluetooth/hci_core.c:1666
 hci_rfkill_set_block+0xe7/0x160 net/bluetooth/hci_core.c:2100
 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:353
 rfkill_fop_write+0x250/0x4a0 net/rfkill/core.c:1249
 do_loop_readv_writev fs/read_write.c:704 [inline]
 do_loop_readv_writev fs/read_write.c:688 [inline]
 do_iter_write+0x461/0x5d0 fs/read_write.c:962
 vfs_writev+0x153/0x2e0 fs/read_write.c:1005
 do_writev+0x136/0x330 fs/read_write.c:1040
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45deb9
Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc32fb8ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000003b9c0 RCX: 000000000045deb9
RDX: 0000000000000001 RSI: 0000000020000080 RDI: 0000000000000003
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007ffde4ec4c1f R14: 00007fc32fb8b9c0 R15: 000000000118bf2c
==================================================================
BUG: KASAN: slab-out-of-bounds in l2cap_sock_teardown_cb+0x628/0x6d0 net/bluetooth/l2cap_sock.c:1342
Read of size 8 at addr ffff8880ab0cd5e8 by task syz-executor.4/13847

CPU: 0 PID: 13847 Comm: syz-executor.4 Not tainted 4.19.159-syzkaller #0
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+0x1fc/0x2fe lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1c7 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 l2cap_sock_teardown_cb+0x628/0x6d0 net/bluetooth/l2cap_sock.c:1342
 l2cap_chan_del+0xbc/0xa50 net/bluetooth/l2cap_core.c:599
 l2cap_conn_del+0x3a6/0x6e0 net/bluetooth/l2cap_core.c:1729
 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7441 [inline]
 l2cap_disconn_cfm+0x98/0xd0 net/bluetooth/l2cap_core.c:7434
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1261 [inline]
 hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1512
 hci_dev_do_close+0x659/0xf10 net/bluetooth/hci_core.c:1666
 hci_rfkill_set_block+0xe7/0x160 net/bluetooth/hci_core.c:2100
 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:353
 rfkill_fop_write+0x250/0x4a0 net/rfkill/core.c:1249
 do_loop_readv_writev fs/read_write.c:704 [inline]
 do_loop_readv_writev fs/read_write.c:688 [inline]
 do_iter_write+0x461/0x5d0 fs/read_write.c:962
 vfs_writev+0x153/0x2e0 fs/read_write.c:1005
 do_writev+0x136/0x330 fs/read_write.c:1040
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45deb9
Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc32fb8ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000003b9c0 RCX: 000000000045deb9
RDX: 0000000000000001 RSI: 0000000020000080 RDI: 0000000000000003
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007ffde4ec4c1f R14: 00007fc32fb8b9c0 R15: 000000000118bf2c

Allocated by task 8109:
 __do_kmalloc_node mm/slab.c:3689 [inline]
 __kmalloc_node+0x4c/0x70 mm/slab.c:3696
 kmalloc_node include/linux/slab.h:557 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:423
 kvmalloc include/linux/mm.h:577 [inline]
 xt_alloc_table_info+0x3c/0xa0 net/netfilter/x_tables.c:1181
 do_replace net/ipv6/netfilter/ip6_tables.c:1145 [inline]
 do_ip6t_set_ctl+0x214/0x425 net/ipv6/netfilter/ip6_tables.c:1684
 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
 nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115
 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945
 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3097
 __sys_setsockopt+0x14d/0x240 net/socket.c:1901
 __do_sys_setsockopt net/socket.c:1912 [inline]
 __se_sys_setsockopt net/socket.c:1909 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:1909
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 10947:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 kvfree+0x59/0x60 mm/util.c:452
 __free_fdtable fs/file.c:31 [inline]
 put_files_struct fs/file.c:420 [inline]
 put_files_struct+0x267/0x350 fs/file.c:413
 exit_files+0x7e/0xa0 fs/file.c:445
 do_exit+0xbb6/0x2be0 kernel/exit.c:885
 do_group_exit+0x125/0x310 kernel/exit.c:993
 get_signal+0x3f2/0x1f70 kernel/signal.c:2589
 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:821
 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880ab0cd180
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1128 bytes inside of
 2048-byte region [ffff8880ab0cd180, ffff8880ab0cd980)
The buggy address belongs to the page:
page:ffffea0002ac3300 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea0002c53708 ffffea00024d4008 ffff88813bff0c40
raw: 0000000000000000 ffff8880ab0cc080 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880ab0cd480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880ab0cd500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880ab0cd580: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
                                                          ^
 ffff8880ab0cd600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880ab0cd680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/22 10:26 linux-4.19.y 76bda503e640 0d27f508 .config console log report info ci2-linux-4-19
2020/11/18 18:06 linux-4.19.y 31acccdc8774 0767f13f .config console log report info ci2-linux-4-19
2020/11/14 14:42 linux-4.19.y 31acccdc8774 1bf9a662 .config console log report info ci2-linux-4-19
* Struck through repros no longer work on HEAD.