================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2f6b/0x5350 kernel/locking/lockdep.c:3665 Read of size 8 at addr ffff88809710aea0 by task kworker/0:1/12 CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.2.0-rc2-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+0x1d7/0x2ce lib/dump_stack.c:113 print_address_description.cold+0x54/0x219 mm/kasan/report.c:188 __kasan_report.cold+0x1a/0x36 mm/kasan/report.c:317 kasan_report+0xe/0x20 mm/kasan/common.c:614 __lock_acquire+0x2f6b/0x5350 kernel/locking/lockdep.c:3665 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:4303 __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+0x3b/0x110 net/core/sock.c:2917 l2cap_sock_teardown_cb+0x88/0x460 net/bluetooth/l2cap_sock.c:1331 l2cap_chan_del+0xad/0x8e0 net/bluetooth/l2cap_core.c:595 l2cap_chan_close+0x108/0x820 net/bluetooth/l2cap_core.c:753 l2cap_chan_timeout+0x16d/0x210 net/bluetooth/l2cap_core.c:424 process_one_work+0x864/0x15b0 kernel/workqueue.c:2269 worker_thread+0x64c/0x1130 kernel/workqueue.c:2415 kthread+0x30b/0x410 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 8571: save_stack mm/kasan/common.c:71 [inline] set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.0+0xd6/0x130 mm/kasan/common.c:489 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15e/0x3f0 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1608 sk_alloc+0x36/0xe90 net/core/sock.c:1662 l2cap_sock_alloc.constprop.0+0x31/0x210 net/bluetooth/l2cap_sock.c:1593 l2cap_sock_create+0x110/0x1b0 net/bluetooth/l2cap_sock.c:1639 bt_sock_create+0x154/0x2a0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x3d8/0x740 net/socket.c:1430 sock_create net/socket.c:1481 [inline] __sys_socket+0xef/0x200 net/socket.c:1523 __do_sys_socket net/socket.c:1532 [inline] __se_sys_socket net/socket.c:1530 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1530 do_syscall_64+0xf9/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8509: save_stack mm/kasan/common.c:71 [inline] set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x10d/0x1b0 mm/kasan/common.c:451 __cache_free mm/slab.c:3432 [inline] kfree+0xcc/0x210 mm/slab.c:3755 sk_prot_free net/core/sock.c:1645 [inline] __sk_destruct+0x673/0x880 net/core/sock.c:1731 sk_destruct net/core/sock.c:1739 [inline] __sk_free+0x105/0x350 net/core/sock.c:1750 sk_free+0x34/0x40 net/core/sock.c:1761 sock_put include/net/sock.h:1728 [inline] l2cap_sock_kill.part.0+0x64/0x80 net/bluetooth/l2cap_sock.c:1058 l2cap_sock_kill net/bluetooth/l2cap_sock.c:1209 [inline] l2cap_sock_release+0x18a/0x1d0 net/bluetooth/l2cap_sock.c:1207 __sock_release+0xcd/0x2a0 net/socket.c:607 sock_close+0x15/0x20 net/socket.c:1279 __fput+0x2db/0x850 fs/file_table.c:280 task_work_run+0x148/0x1c0 kernel/task_work.c:113 get_signal+0x1d12/0x2160 kernel/signal.c:2434 do_signal+0x81/0x1620 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x586/0x680 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809710ae00 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff88809710ae00, ffff88809710b600) The buggy address belongs to the page: page:ffffea00025c4280 refcount:1 mapcount:0 mapping:ffff8880aa000c40 index:0xffff88809710ae00 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0002221f08 ffffea0001f93408 ffff8880aa000c40 raw: ffff88809710ae00 ffff88809710a580 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809710ad80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809710ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809710ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809710af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809710af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================