INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 8109 Comm: kworker/0:4 Not tainted 5.8.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 assign_lock_key kernel/locking/lockdep.c:894 [inline] register_lock_class+0x157d/0x1630 kernel/locking/lockdep.c:1206 __lock_acquire+0xf9/0x5640 kernel/locking/lockdep.c:4305 lock_acquire+0x1f1/0xad0 kernel/locking/lockdep.c:5005 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x3b/0x110 net/core/sock.c:3040 l2cap_sock_teardown_cb+0x88/0x400 net/bluetooth/l2cap_sock.c:1520 l2cap_chan_del+0xad/0x1300 net/bluetooth/l2cap_core.c:618 l2cap_chan_close+0x118/0xb10 net/bluetooth/l2cap_core.c:823 l2cap_chan_timeout+0x173/0x450 net/bluetooth/l2cap_core.c:436 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 ================================================================== BUG: KASAN: use-after-free in arch_atomic_read arch/x86/include/asm/atomic.h:29 [inline] BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:28 [inline] BUG: KASAN: use-after-free in pv_hybrid_queued_unfair_trylock kernel/locking/qspinlock_paravirt.h:88 [inline] BUG: KASAN: use-after-free in __pv_queued_spin_lock_slowpath+0x93d/0xaf0 kernel/locking/qspinlock.c:443 Read of size 4 at addr ffff88808acfe088 by task kworker/0:4/8109 CPU: 0 PID: 8109 Comm: kworker/0:4 Not tainted 5.8.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 arch_atomic_read arch/x86/include/asm/atomic.h:29 [inline] atomic_read include/asm-generic/atomic-instrumented.h:28 [inline] pv_hybrid_queued_unfair_trylock kernel/locking/qspinlock_paravirt.h:88 [inline] __pv_queued_spin_lock_slowpath+0x93d/0xaf0 kernel/locking/qspinlock.c:443 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:656 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:50 [inline] queued_spin_lock include/asm-generic/qspinlock.h:82 [inline] do_raw_spin_lock+0x200/0x2b0 kernel/locking/spinlock_debug.c:113 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x3b/0x110 net/core/sock.c:3040 l2cap_sock_teardown_cb+0x88/0x400 net/bluetooth/l2cap_sock.c:1520 l2cap_chan_del+0xad/0x1300 net/bluetooth/l2cap_core.c:618 l2cap_chan_close+0x118/0xb10 net/bluetooth/l2cap_core.c:823 l2cap_chan_timeout+0x173/0x450 net/bluetooth/l2cap_core.c:436 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 10517: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494 kmem_cache_alloc_trace+0x14f/0x2d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] l2cap_chan_create+0x40/0x3a0 net/bluetooth/l2cap_core.c:450 l2cap_sock_alloc.constprop.0+0x185/0x230 net/bluetooth/l2cap_sock.c:1805 l2cap_sock_create+0x110/0x1b0 net/bluetooth/l2cap_sock.c:1836 bt_sock_create+0x154/0x2a0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x3ca/0x740 net/socket.c:1427 sock_create net/socket.c:1478 [inline] __sys_socket+0xef/0x200 net/socket.c:1520 __do_sys_socket net/socket.c:1529 [inline] __se_sys_socket net/socket.c:1527 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1527 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 10517: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x103/0x2c0 mm/slab.c:3757 l2cap_chan_destroy net/bluetooth/l2cap_core.c:488 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x1b2/0x230 net/bluetooth/l2cap_core.c:502 l2cap_sock_release+0x181/0x1d0 net/bluetooth/l2cap_sock.c:1392 __sock_release+0xcd/0x280 net/socket.c:596 sock_close+0x18/0x20 net/socket.c:1277 __fput+0x33c/0x880 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:135 get_signal+0xd6c/0x1ee0 kernel/signal.c:2547 arch_do_signal+0x82/0x2520 arch/x86/kernel/signal.c:811 exit_to_user_mode_loop kernel/entry/common.c:135 [inline] exit_to_user_mode_prepare+0x172/0x1d0 kernel/entry/common.c:166 syscall_exit_to_user_mode+0x59/0x2b0 kernel/entry/common.c:241 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88808acfe000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 136 bytes inside of 2048-byte region [ffff88808acfe000, ffff88808acfe800) The buggy address belongs to the page: page:ffffea00022b3f80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00022a4f08 ffffea00028ca908 ffff8880aa000e00 raw: 0000000000000000 ffff88808acfe000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808acfdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808acfe000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808acfe080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808acfe100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808acfe180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================