================================================================== BUG: KASAN: use-after-free in trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline] BUG: KASAN: use-after-free in perf_trace_lock_acquire+0x402/0x530 include/trace/events/lock.h:13 Read of size 8 at addr ffff88809a4e4978 by task kworker/1:2/3576 CPU: 1 PID: 3576 Comm: kworker/1:2 Not tainted 4.19.167-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+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 trace_event_get_offsets_lock_acquire include/trace/events/lock.h:13 [inline] perf_trace_lock_acquire+0x402/0x530 include/trace/events/lock.h:13 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x298/0x3c0 kernel/locking/lockdep.c:3906 __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_chan_close+0x1b5/0x950 net/bluetooth/l2cap_core.c:757 l2cap_chan_timeout+0x17e/0x2f0 net/bluetooth/l2cap_core.c:430 process_one_work+0x864/0x1570 kernel/workqueue.c:2155 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 335: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1466 sk_alloc+0x36/0xec0 net/core/sock.c:1520 base_sock_create drivers/isdn/mISDN/socket.c:770 [inline] mISDN_sock_create+0xce/0x3d0 drivers/isdn/mISDN/socket.c:792 __sock_create+0x3d8/0x740 net/socket.c:1276 sock_create net/socket.c:1316 [inline] __sys_socket+0xef/0x200 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1353 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 333: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 sk_prot_free net/core/sock.c:1503 [inline] __sk_destruct+0x684/0x8a0 net/core/sock.c:1584 sk_destruct net/core/sock.c:1599 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1610 sk_free+0x3b/0x50 net/core/sock.c:1621 sock_put include/net/sock.h:1711 [inline] base_sock_release+0x10a/0x115 drivers/isdn/mISDN/socket.c:638 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 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 ffff88809a4e48c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 184 bytes inside of 2048-byte region [ffff88809a4e48c0, ffff88809a4e50c0) The buggy address belongs to the page: page:ffffea0002693900 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0xffff88809a4e5140 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002720c88 ffffea0002986688 ffff88813bff0c40 raw: ffff88809a4e5140 ffff88809a4e4040 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809a4e4800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88809a4e4880: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88809a4e4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809a4e4980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809a4e4a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================