================================================================== BUG: KASAN: use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:197 [inline] BUG: KASAN: use-after-free in __mutex_lock_common+0xae8/0x1f38 kernel/locking/mutex.c:681 Read of size 8 at addr ffff0000fec44060 by task khidpd_16c005df/5172 CPU: 0 PID: 5172 Comm: khidpd_16c005df Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x88/0x218 mm/kasan/report.c:316 print_report+0x50/0x68 mm/kasan/report.c:420 kasan_report+0xa8/0x100 mm/kasan/report.c:524 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 __mutex_waiter_is_first kernel/locking/mutex.c:197 [inline] __mutex_lock_common+0xae8/0x1f38 kernel/locking/mutex.c:681 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 l2cap_unregister_user+0x70/0x18c net/bluetooth/l2cap_core.c:1895 hidp_session_thread+0x3d0/0x46c net/bluetooth/hidp/core.c:1305 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 The buggy address belongs to the physical page: page:000000009d165868 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13ec44 head:000000009d165868 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010000(head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000fec43f00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff0000fec43f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000fec44000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff0000fec44080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000fec44100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ================================================================================ UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.c:131:9 index 15412 is out of range for type 'unsigned long[8]' CPU: 0 PID: 5172 Comm: khidpd_16c005df Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ubsan_epilogue+0x14/0x48 lib/ubsan.c:151 __ubsan_handle_out_of_bounds+0xd0/0xfc lib/ubsan.c:282 decode_tail kernel/locking/qspinlock.c:131 [inline] queued_spin_lock_slowpath+0xab0/0xc08 kernel/locking/qspinlock.c:471 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x2e8/0x2ec kernel/locking/spinlock_debug.c:115 __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline] _raw_spin_lock+0x5c/0x6c kernel/locking/spinlock.c:154 __mutex_lock_common+0x94c/0x1f38 kernel/locking/mutex.c:699 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 l2cap_unregister_user+0x70/0x18c net/bluetooth/l2cap_core.c:1895 hidp_session_thread+0x3d0/0x46c net/bluetooth/hidp/core.c:1305 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 ================================================================================ Unable to handle kernel paging request at virtual address ffff800014fb9f80 KASAN: probably user-memory-access in range [0x00000000a7dcfc00-0x00000000a7dcfc07] Mem abort info: ESR = 0x0000000096000047 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x07: level 3 translation fault Data abort info: ISV = 0, ISS = 0x00000047 CM = 0, WnR = 1 swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000020e1fd000 [ffff800014fb9f80] pgd=100000023ffff003, p4d=100000023ffff003, pud=100000023fffe003, pmd=100000023fffc003, pte=0000000000000000 Internal error: Oops: 0000000096000047 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 5172 Comm: khidpd_16c005df Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : queued_spin_lock_slowpath+0x914/0xc08 kernel/locking/qspinlock.c:474 lr : decode_tail kernel/locking/qspinlock.c:131 [inline] lr : queued_spin_lock_slowpath+0xab0/0xc08 kernel/locking/qspinlock.c:471 sp : ffff800021227940 x29: ffff8000212279e0 x28: ffff800014fb9f80 x27: ffff800014fb9f80 x26: 1fffe0001fd88803 x25: 1fffe00033eea3f0 x24: dfff800000000000 x23: ffff700004244f2c x22: ffff00019f751f88 x21: 0000000000040000 x20: ffff00019f751f80 x19: ffff0000fec44018 x18: ffff800011a5bd40 x17: 3d3d3d3d3d3d3d3d x16: ffff800008191ac0 x15: 0000000000000000 x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000ff0100 x11: ff00800008191b44 x10: ffff800014fb9f80 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800021227398 x4 : ffff800015134e00 x3 : ffff800008191b0c x2 : 0000000000000001 x1 : 0000000000000004 x0 : ffff00019f751f88 Call trace: queued_spin_lock_slowpath+0x914/0xc08 kernel/locking/qspinlock.c:477 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x2e8/0x2ec kernel/locking/spinlock_debug.c:115 __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline] _raw_spin_lock+0x5c/0x6c kernel/locking/spinlock.c:154 __mutex_lock_common+0x94c/0x1f38 kernel/locking/mutex.c:699 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 l2cap_unregister_user+0x70/0x18c net/bluetooth/l2cap_core.c:1895 hidp_session_thread+0x3d0/0x46c net/bluetooth/hidp/core.c:1305 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Code: aa1b03e0 979830c9 aa1603e0 52800081 (f9000374) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: aa1b03e0 mov x0, x27 4: 979830c9 bl 0xfffffffffe60c328 8: aa1603e0 mov x0, x22 c: 52800081 mov w1, #0x4 // #4 * 10: f9000374 str x20, [x27] <-- trapping instruction