================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3671/0x4370 kernel/locking/lockdep.c:3828 Read of size 8 at addr ffff8881def540a0 by task kworker/0:2/3093 CPU: 0 PID: 3093 Comm: kworker/0:2 Not tainted 5.4.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+0x128/0x182 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x317 mm/kasan/report.c:374 __kasan_report.cold.11+0x1c/0x37 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:634 __lock_acquire+0x3671/0x4370 kernel/locking/lockdep.c:3828 lock_acquire+0x19b/0x420 kernel/locking/lockdep.c:4487 __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:343 [inline] lock_sock_nested+0x35/0xf0 net/core/sock.c:2938 l2cap_sock_teardown_cb+0x7f/0x380 net/bluetooth/l2cap_sock.c:1331 l2cap_chan_del+0x9a/0x7e0 net/bluetooth/l2cap_core.c:603 l2cap_chan_close+0x34a/0x7d0 net/bluetooth/l2cap_core.c:761 l2cap_chan_timeout+0x115/0x1d0 net/bluetooth/l2cap_core.c:432 process_one_work+0x8d1/0x15c0 kernel/workqueue.c:2269 worker_thread+0x82/0xb50 kernel/workqueue.c:2415 kthread+0x31d/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 9548: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.13+0xc1/0xd0 mm/kasan/common.c:483 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x164/0x7b0 mm/slab.c:3664 kmalloc include/linux/slab.h:561 [inline] sk_prot_alloc+0x14d/0x260 net/core/sock.c:1605 sk_alloc+0x30/0xc80 net/core/sock.c:1659 l2cap_sock_alloc.constprop.8+0x23/0x1f0 net/bluetooth/l2cap_sock.c:1593 l2cap_sock_create+0xb1/0x190 net/bluetooth/l2cap_sock.c:1639 bt_sock_create+0x120/0x250 net/bluetooth/af_bluetooth.c:130 __sock_create+0x267/0x540 net/socket.c:1418 sock_create net/socket.c:1469 [inline] __sys_socket+0xd1/0x1a0 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1518 do_syscall_64+0xc6/0x5d0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9548: save_stack+0x19/0x80 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:471 __cache_free mm/slab.c:3425 [inline] kfree+0x107/0x2b0 mm/slab.c:3756 sk_prot_free net/core/sock.c:1642 [inline] __sk_destruct+0x451/0x600 net/core/sock.c:1726 l2cap_sock_release+0x104/0x130 net/bluetooth/l2cap_sock.c:1207 __sock_release+0xbb/0x270 net/socket.c:590 sock_close+0xf/0x20 net/socket.c:1268 __fput+0x256/0x780 fs/file_table.c:280 task_work_run+0x103/0x180 kernel/task_work.c:113 get_signal+0x16da/0x1d90 kernel/signal.c:2528 do_signal+0x81/0x13f0 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x10f/0x2d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x4e2/0x5d0 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881def54000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff8881def54000, ffff8881def54800) The buggy address belongs to the page: page:ffffea00077bd500 refcount:1 mapcount:0 mapping:ffff8881f5400e00 index:0x0 raw: 017ffe0000000200 ffffea00077c52c8 ffffea00077bc508 ffff8881f5400e00 raw: 0000000000000000 ffff8881def54000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881def53f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881def54000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881def54080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881def54100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881def54180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================