================================================================== BUG: KASAN: slab-use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:182 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:680 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x738/0xe80 kernel/locking/mutex.c:746 Read of size 8 at addr ffff88807da38060 by task khidpd_16c05505/6040 CPU: 1 UID: 0 PID: 6040 Comm: khidpd_16c05505 Not tainted 6.15.0-rc5-syzkaller-01021-g0b28182c73a3 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 __mutex_waiter_is_first kernel/locking/mutex.c:182 [inline] __mutex_lock_common kernel/locking/mutex.c:680 [inline] __mutex_lock+0x738/0xe80 kernel/locking/mutex.c:746 l2cap_unregister_user+0x6a/0x1b0 net/bluetooth/l2cap_core.c:1727 hidp_session_thread+0x3c9/0x410 net/bluetooth/hidp/core.c:1304 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5943: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4339 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] hci_alloc_dev_priv+0x27/0x1ff0 net/bluetooth/hci_core.c:2420 hci_alloc_dev include/net/bluetooth/hci_core.h:1712 [inline] __vhci_create_device drivers/bluetooth/hci_vhci.c:399 [inline] vhci_create_device+0x120/0x6e0 drivers/bluetooth/hci_vhci.c:471 vhci_get_user drivers/bluetooth/hci_vhci.c:528 [inline] vhci_write+0x3ce/0x4a0 drivers/bluetooth/hci_vhci.c:608 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x548/0xa90 fs/read_write.c:684 ksys_write+0x145/0x250 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5943: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kfree+0x193/0x440 mm/slub.c:4841 hci_release_dev+0x1402/0x1570 net/bluetooth/hci_core.c:2739 bt_host_release+0x82/0x90 net/bluetooth/hci_sysfs.c:87 device_release+0x99/0x1c0 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x228/0x480 lib/kobject.c:737 vhci_release+0x88/0xd0 drivers/bluetooth/hci_vhci.c:666 __fput+0x449/0xa70 fs/file_table.c:465 task_work_run+0x1d1/0x260 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x8d6/0x2550 kernel/exit.c:953 do_group_exit+0x21c/0x2d0 kernel/exit.c:1102 get_signal+0x125e/0x1310 kernel/signal.c:3034 arch_do_signal_or_restart+0x95/0x780 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x8b/0x120 kernel/entry/common.c:218 do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:548 insert_work+0x3d/0x330 kernel/workqueue.c:2183 __queue_work+0xbd9/0xfe0 kernel/workqueue.c:2345 queue_work_on+0x181/0x270 kernel/workqueue.c:2392 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Second to last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:548 insert_work+0x3d/0x330 kernel/workqueue.c:2183 __queue_work+0xcfc/0xfe0 kernel/workqueue.c:2341 call_timer_fn+0x17b/0x5f0 kernel/time/timer.c:1789 expire_timers kernel/time/timer.c:1835 [inline] __run_timers kernel/time/timer.c:2414 [inline] __run_timer_base+0x646/0x860 kernel/time/timer.c:2426 run_timer_base kernel/time/timer.c:2435 [inline] run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2445 handle_softirqs+0x283/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff88807da38000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 96 bytes inside of freed 8192-byte region [ffff88807da38000, ffff88807da3a000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7da38 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a042280 ffffea0001e91200 dead000000000005 raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a042280 ffffea0001e91200 dead000000000005 head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001f68e01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5567, tgid 5567 (rcS), ts 55762045289, free_ts 55642919425 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x21e0/0x22c0 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4966 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4353 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] tomoyo_print_bprm security/tomoyo/audit.c:26 [inline] tomoyo_init_log+0x111f/0x1f70 security/tomoyo/audit.c:264 tomoyo_supervisor+0x340/0x1480 security/tomoyo/common.c:2198 tomoyo_find_next_domain+0x488/0x1aa0 security/tomoyo/domain.c:762 tomoyo_bprm_check_security+0x11c/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x89/0x270 security/security.c:1302 search_binary_handler fs/exec.c:1768 [inline] exec_binprm fs/exec.c:1810 [inline] bprm_execve+0x8ee/0x1440 fs/exec.c:1862 do_execveat_common+0x510/0x6a0 fs/exec.c:1968 do_execve fs/exec.c:2042 [inline] __do_sys_execve fs/exec.c:2118 [inline] __se_sys_execve fs/exec.c:2113 [inline] __x64_sys_execve+0x94/0xb0 fs/exec.c:2113 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 page last free pid 5563 tgid 5563 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0xb14/0xce0 mm/page_alloc.c:2721 discard_slab mm/slub.c:2716 [inline] __put_partials+0x161/0x1c0 mm/slub.c:3185 put_cpu_partial+0x17c/0x250 mm/slub.c:3260 __slab_free+0x2f7/0x400 mm/slub.c:4512 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 vm_area_alloc+0x24/0x140 kernel/fork.c:441 __mmap_new_vma mm/vma.c:2402 [inline] __mmap_region mm/vma.c:2519 [inline] mmap_region+0xcf4/0x1e50 mm/vma.c:2597 do_mmap+0xc68/0x1100 mm/mmap.c:561 vm_mmap_pgoff+0x31b/0x4c0 mm/util.c:579 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:607 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807da37f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807da37f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807da38000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807da38080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807da38100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================