================================================================== BUG: KASAN: slab-use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:197 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock_common+0xbec/0x21a0 kernel/locking/mutex.c:686 Read of size 8 at addr ffff0000cb364060 by task khidpd_046d0a2e/7669 CPU: 1 UID: 0 PID: 7669 Comm: khidpd_046d0a2e Not tainted 6.12.0-rc5-syzkaller-g1bf329c696cf #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __mutex_waiter_is_first kernel/locking/mutex.c:197 [inline] __mutex_lock_common+0xbec/0x21a0 kernel/locking/mutex.c:686 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 l2cap_unregister_user+0x74/0x190 net/bluetooth/l2cap_core.c:1726 hidp_session_thread+0x46c/0x508 net/bluetooth/hidp/core.c:1304 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 7564: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_noprof+0x2a4/0x49c mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] hci_alloc_dev_priv+0x30/0x1ae0 net/bluetooth/hci_core.c:2440 hci_alloc_dev include/net/bluetooth/hci_core.h:1621 [inline] __vhci_create_device drivers/bluetooth/hci_vhci.c:399 [inline] vhci_create_device+0x114/0x68c drivers/bluetooth/hci_vhci.c:470 vhci_get_user drivers/bluetooth/hci_vhci.c:527 [inline] vhci_write+0x324/0x3c8 drivers/bluetooth/hci_vhci.c:607 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x920/0xcf4 fs/read_write.c:683 ksys_write+0x15c/0x26c fs/read_write.c:736 __do_sys_write fs/read_write.c:748 [inline] __se_sys_write fs/read_write.c:745 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:745 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Freed by task 7564: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x64/0x8c mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x184/0x47c mm/slub.c:4727 hci_release_dev+0x1044/0x11a4 net/bluetooth/hci_core.c:2759 bt_host_release+0x70/0x88 net/bluetooth/hci_sysfs.c:94 device_release+0x8c/0x1ac kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2a8/0x41c lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3783 hci_free_dev+0x24/0x34 net/bluetooth/hci_core.c:2565 vhci_release+0x84/0xd0 drivers/bluetooth/hci_vhci.c:665 __fput+0x1bc/0x75c fs/file_table.c:431 ____fput+0x20/0x30 fs/file_table.c:459 task_work_run+0x230/0x2e0 kernel/task_work.c:239 exit_task_work include/linux/task_work.h:43 [inline] do_exit+0x4ec/0x1ad0 kernel/exit.c:939 do_group_exit+0x194/0x22c kernel/exit.c:1088 __do_sys_exit_group kernel/exit.c:1099 [inline] __se_sys_exit_group kernel/exit.c:1097 [inline] pid_child_should_wake+0x0/0x1dc kernel/exit.c:1097 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xd0/0xec mm/kasan/generic.c:541 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:551 insert_work+0x54/0x2d4 kernel/workqueue.c:2183 __queue_work+0xcf4/0x1308 kernel/workqueue.c:2343 queue_work_on+0xe0/0x1a0 kernel/workqueue.c:2390 queue_work include/linux/workqueue.h:662 [inline] hci_cmd_timeout+0x198/0x1cc net/bluetooth/hci_core.c:1464 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Second to last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xd0/0xec mm/kasan/generic.c:541 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:551 insert_work+0x54/0x2d4 kernel/workqueue.c:2183 __queue_work+0xe20/0x1308 kernel/workqueue.c:2339 delayed_work_timer_fn+0x74/0x90 kernel/workqueue.c:2485 call_timer_fn+0x1b4/0x8e8 kernel/time/timer.c:1794 expire_timers kernel/time/timer.c:1840 [inline] __run_timers kernel/time/timer.c:2419 [inline] __run_timer_base+0x59c/0x7b4 kernel/time/timer.c:2430 run_timer_base kernel/time/timer.c:2439 [inline] run_timer_softirq+0xcc/0x194 kernel/time/timer.c:2449 handle_softirqs+0x2e0/0xbf8 kernel/softirq.c:554 __do_softirq+0x14/0x20 kernel/softirq.c:588 The buggy address belongs to the object at ffff0000cb364000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 96 bytes inside of freed 8192-byte region [ffff0000cb364000, ffff0000cb366000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b360 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c0002280 fffffdffc3291600 0000000000000002 raw: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0002280 fffffdffc3291600 0000000000000002 head: 0000000000000000 0000000000020002 00000001f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc32cd801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cb363f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000cb363f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000cb364000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cb364080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cb364100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================