================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3cfc/0x5b00 kernel/locking/lockdep.c:4825 Read of size 8 at addr ffff888047e28488 by task syz-executor.1/28261 CPU: 0 PID: 28261 Comm: syz-executor.1 Not tainted 5.10.245 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x220 mm/kasan/report.c:377 __kasan_report mm/kasan/report.c:537 [inline] kasan_report.cold+0x37/0x7c mm/kasan/report.c:554 __lock_acquire+0x3cfc/0x5b00 kernel/locking/lockdep.c:4825 lock_acquire kernel/locking/lockdep.c:5566 [inline] lock_acquire+0x197/0x470 kernel/locking/lockdep.c:5531 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 kernel/locking/spinlock.c:159 skb_dequeue+0x1c/0x180 net/core/skbuff.c:3124 skb_queue_purge+0x21/0x30 net/core/skbuff.c:3162 vhci_flush+0x37/0x50 include/linux/skbuff.h:1875 hci_dev_do_reset net/bluetooth/hci_core.c:1895 [inline] hci_dev_reset+0x453/0x6b0 net/bluetooth/hci_core.c:1930 hci_sock_ioctl+0x3b2/0x980 net/bluetooth/hci_sock.c:1072 sock_do_ioctl+0xd3/0x300 net/socket.c:1066 sock_ioctl+0x3ef/0x710 net/socket.c:1206 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 RIP: 0033:0x7fee4017cb19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fee3d6d1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fee40290020 RCX: 00007fee4017cb19 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000008 RBP: 00007fee401d6f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe1e5a2e3f R14: 00007fee3d6d1300 R15: 0000000000022000 Allocated by task 19619: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc9/0xd0 mm/kasan/common.c:461 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] vhci_open+0x48/0x320 drivers/bluetooth/hci_vhci.c:317 misc_open+0x375/0x4a0 drivers/char/misc.c:141 chrdev_open+0x268/0x6e0 fs/char_dev.c:414 do_dentry_open+0x4b7/0x1090 fs/open.c:817 do_open fs/namei.c:3307 [inline] path_openat+0x19ba/0x2770 fs/namei.c:3425 do_filp_open+0x190/0x3e0 fs/namei.c:3452 do_sys_openat2+0x171/0x4d0 fs/open.c:1227 do_sys_open fs/open.c:1243 [inline] __do_sys_openat fs/open.c:1259 [inline] __se_sys_openat fs/open.c:1254 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1254 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 Freed by task 19619: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x110/0x160 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0xa9/0x180 mm/slub.c:1581 slab_free mm/slub.c:3154 [inline] kfree+0xd7/0x340 mm/slub.c:4130 vhci_release+0xb0/0xf0 drivers/bluetooth/hci_vhci.c:351 __fput+0x285/0x9f0 fs/file_table.c:281 task_work_run+0xe2/0x1a0 kernel/task_work.c:185 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xb77/0x2600 kernel/exit.c:869 do_group_exit+0x125/0x310 kernel/exit.c:983 __do_sys_exit_group kernel/exit.c:994 [inline] __se_sys_exit_group kernel/exit.c:992 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:992 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x67/0xd1 The buggy address belongs to the object at ffff888047e28400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 136 bytes inside of 512-byte region [ffff888047e28400, ffff888047e28600) The buggy address belongs to the page: page:0000000078cf1554 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888047e2bc00 pfn:0x47e28 head:0000000078cf1554 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head) raw: 0100000000010200 ffffea0001538b08 ffffea00011bde08 ffff888008041280 raw: ffff888047e2bc00 0000000000100003 00000001ffffffff ffff888009143901 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888009143901 Memory state around the buggy address: ffff888047e28380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888047e28400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888047e28480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888047e28500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888047e28580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Bluetooth: hci0: command 0x0409 tx timeout Bluetooth: hci4: command 0x0409 tx timeout wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready Bluetooth: hci4: command 0x041b tx timeout Bluetooth: hci4: command 0x040f tx timeout