================================================================== BUG: KASAN: use-after-free in l2cap_sock_new_connection_cb+0x1d4/0x280 net/bluetooth/l2cap_sock.c:1520 Read of size 8 at addr ffff0000f4326548 by task kworker/u5:1/4322 CPU: 1 PID: 4322 Comm: kworker/u5:1 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci1 hci_rx_work Call trace: dump_backtrace+0x1c0/0x1ec 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+0xf4/0x15c 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/0xfc mm/kasan/report.c:524 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 l2cap_sock_new_connection_cb+0x1d4/0x280 net/bluetooth/l2cap_sock.c:1520 l2cap_connect_cfm+0x2d4/0xd98 net/bluetooth/l2cap_core.c:8349 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1814 le_conn_complete_evt+0xd30/0x1244 net/bluetooth/hci_event.c:5882 hci_le_conn_complete_evt+0x114/0x3f4 net/bluetooth/hci_event.c:5908 hci_le_meta_evt+0x2c0/0x4a0 net/bluetooth/hci_event.c:7101 hci_event_func net/bluetooth/hci_event.c:7412 [inline] hci_event_packet+0x6b8/0xf18 net/bluetooth/hci_event.c:7467 hci_rx_work+0x324/0xa80 net/bluetooth/hci_core.c:4083 process_one_work+0x7f8/0x13a4 kernel/workqueue.c:2292 worker_thread+0x8c4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Allocated by task 4322: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:375 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc+0xec/0x178 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] sk_prot_alloc+0xc4/0x1ec net/core/sock.c:2052 sk_alloc+0x44/0x390 net/core/sock.c:2108 bt_sock_alloc+0x4c/0x140 net/bluetooth/af_bluetooth.c:148 l2cap_sock_alloc net/bluetooth/l2cap_sock.c:1917 [inline] l2cap_sock_new_connection_cb+0xe4/0x280 net/bluetooth/l2cap_sock.c:1505 l2cap_connect_cfm+0x2d4/0xd98 net/bluetooth/l2cap_core.c:8349 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1814 le_conn_complete_evt+0xd30/0x1244 net/bluetooth/hci_event.c:5882 hci_le_conn_complete_evt+0x114/0x3f4 net/bluetooth/hci_event.c:5908 hci_le_meta_evt+0x2c0/0x4a0 net/bluetooth/hci_event.c:7101 hci_event_func net/bluetooth/hci_event.c:7412 [inline] hci_event_packet+0x6b8/0xf18 net/bluetooth/hci_event.c:7467 hci_rx_work+0x324/0xa80 net/bluetooth/hci_core.c:4083 process_one_work+0x7f8/0x13a4 kernel/workqueue.c:2292 worker_thread+0x8c4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Freed by task 4542: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:53 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:237 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:245 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x16c/0x1e8 mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] __kmem_cache_free+0xbc/0x218 mm/slub.c:3700 kfree+0xd0/0x1a8 mm/slab_common.c:988 sk_prot_free net/core/sock.c:2091 [inline] __sk_destruct+0x4dc/0x76c net/core/sock.c:2177 sk_destruct net/core/sock.c:2192 [inline] __sk_free+0x320/0x430 net/core/sock.c:2203 sk_free+0x60/0xc4 net/core/sock.c:2214 sock_put include/net/sock.h:2085 [inline] l2cap_sock_kill+0x12c/0x22c net/bluetooth/l2cap_sock.c:1284 l2cap_sock_cleanup_listen+0xf4/0x284 net/bluetooth/l2cap_sock.c:1485 l2cap_sock_release+0x68/0x1bc net/bluetooth/l2cap_sock.c:1446 __sock_release net/socket.c:654 [inline] sock_close+0xb4/0x1f8 net/socket.c:1399 __fput+0x1bc/0x7b8 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x278 kernel/task_work.c:203 get_signal+0x111c/0x1304 kernel/signal.c:2648 do_signal arch/arm64/kernel/signal.c:1095 [inline] do_notify_resume+0x33c/0x2aa4 arch/arm64/kernel/signal.c:1148 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:46 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0x100/0x94c kernel/rcu/tree.c:2849 netlink_release+0x1288/0x172c net/netlink/af_netlink.c:799 __sock_release net/socket.c:654 [inline] sock_close+0xb4/0x1f8 net/socket.c:1399 __fput+0x1bc/0x7b8 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x278 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x1fa0/0x2aa4 arch/arm64/kernel/signal.c:1151 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000f4326000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1352 bytes inside of 2048-byte region [ffff0000f4326000, ffff0000f4326800) The buggy address belongs to the physical page: page:00000000574e37cd refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000f4322000 pfn:0x134320 head:00000000574e37cd order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000001 ffff0000c0002900 raw: ffff0000f4322000 0000000080080007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f4326400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f4326480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000f4326500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f4326580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f4326600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 4322 at lib/refcount.c:25 refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 4322 Comm: kworker/u5:1 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci1 hci_rx_work pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 lr : refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 sp : ffff800020f97570 x29: ffff800020f97570 x28: dfff800000000000 x27: 0000000000000000 x26: 1fffe0001e864e07 x25: 1fffe0001b6c7b00 x24: dfff800000000000 x23: 0000000000000000 x22: ffff0000f4327018 x21: ffff0000f432703f x20: ffff0000f4327018 x19: ffff800017bd9000 x18: ffff800011b8bf60 x17: 0000000000000000 x16: ffff80000804309c x15: 0000000000000002 x14: 0000000000000001 x13: 1fffe00033eac9a3 x12: 0000000000100000 x11: 000000000007380d x10: ffff800031b2a000 x9 : cd6c27d7ed02f200 x8 : cd6c27d7ed02f200 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800020f96ff8 x4 : ffff8000152f4cc0 x3 : ffff800008538704 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 __refcount_add include/linux/refcount.h:-1 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] kref_get include/linux/kref.h:45 [inline] l2cap_chan_hold net/bluetooth/l2cap_core.c:522 [inline] __l2cap_chan_add+0x4cc/0x7b4 net/bluetooth/l2cap_core.c:653 l2cap_connect_cfm+0x380/0xd98 net/bluetooth/l2cap_core.c:8356 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1814 le_conn_complete_evt+0xd30/0x1244 net/bluetooth/hci_event.c:5882 hci_le_conn_complete_evt+0x114/0x3f4 net/bluetooth/hci_event.c:5908 hci_le_meta_evt+0x2c0/0x4a0 net/bluetooth/hci_event.c:7101 hci_event_func net/bluetooth/hci_event.c:7412 [inline] hci_event_packet+0x6b8/0xf18 net/bluetooth/hci_event.c:7467 hci_rx_work+0x324/0xa80 net/bluetooth/hci_core.c:4083 process_one_work+0x7f8/0x13a4 kernel/workqueue.c:2292 worker_thread+0x8c4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 irq event stamp: 1719 hardirqs last enabled at (1719): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1374 [inline] hardirqs last enabled at (1719): [] finish_lock_switch+0xb0/0x1c4 kernel/sched/core.c:5004 hardirqs last disabled at (1718): [] __schedule+0x298/0x1b0c kernel/sched/core.c:6460 softirqs last enabled at (1218): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (1218): [] release_sock+0x16c/0x1bc net/core/sock.c:3522 softirqs last disabled at (1214): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (1214): [] release_sock+0x34/0x1bc net/core/sock.c:3509 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ ODEBUG: assert_init not available (active state 0) object type: timer_list hint: l2cap_chan_timeout+0x0/0x27c net/bluetooth/l2cap_core.c:-1 WARNING: CPU: 1 PID: 4322 at lib/debugobjects.c:518 debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 Modules linked in: CPU: 1 PID: 4322 Comm: kworker/u5:1 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci1 hci_rx_work pstate: 624000c5 (nZCv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 lr : debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 sp : ffff800020f97270 x29: ffff800020f97270 x28: 1fffe0001e864e06 x27: 0000000000000006 x26: ffff800015210000 x25: ffff8000083b6624 x24: dfff800000000000 x23: 0000000000000000 x22: ffff800010c81ed4 x21: ffff80001207c1a0 x20: ffff800011bab020 x19: ffff80001207bce0 x18: ffff800011b8bf60 x17: 203a657079742074 x16: ffff8000082ef028 x15: 0000000000000002 x14: 0000000000000001 x13: 1fffe00033eac9a3 x12: 0000000000100000 x11: 00000000000900c1 x10: ffff800031b2a000 x9 : cd6c27d7ed02f200 x8 : cd6c27d7ed02f200 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800020f96cf8 x4 : ffff8000152f4cc0 x3 : ffff800008538704 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 debug_object_assert_init+0x250/0x2c8 lib/debugobjects.c:900 debug_timer_assert_init kernel/time/timer.c:792 [inline] debug_assert_init kernel/time/timer.c:837 [inline] __timer_delete+0x4c/0x218 kernel/time/timer.c:1321 timer_delete+0x24/0x34 kernel/time/timer.c:1361 del_timer include/linux/timer.h:213 [inline] try_to_grab_pending+0xa4/0x654 kernel/workqueue.c:1278 __cancel_work+0x44/0x224 kernel/workqueue.c:3251 cancel_delayed_work+0x24/0x38 kernel/workqueue.c:3289 l2cap_clear_timer include/net/bluetooth/l2cap.h:892 [inline] l2cap_chan_ready net/bluetooth/l2cap_core.c:1399 [inline] l2cap_le_start+0x768/0x1028 net/bluetooth/l2cap_core.c:1523 l2cap_conn_ready net/bluetooth/l2cap_core.c:1793 [inline] l2cap_connect_cfm+0x57c/0xd98 net/bluetooth/l2cap_core.c:8366 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1814 le_conn_complete_evt+0xd30/0x1244 net/bluetooth/hci_event.c:5882 hci_le_conn_complete_evt+0x114/0x3f4 net/bluetooth/hci_event.c:5908 hci_le_meta_evt+0x2c0/0x4a0 net/bluetooth/hci_event.c:7101 hci_event_func net/bluetooth/hci_event.c:7412 [inline] hci_event_packet+0x6b8/0xf18 net/bluetooth/hci_event.c:7467 hci_rx_work+0x324/0xa80 net/bluetooth/hci_core.c:4083 process_one_work+0x7f8/0x13a4 kernel/workqueue.c:2292 worker_thread+0x8c4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 irq event stamp: 1719 hardirqs last enabled at (1719): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1374 [inline] hardirqs last enabled at (1719): [] finish_lock_switch+0xb0/0x1c4 kernel/sched/core.c:5004 hardirqs last disabled at (1718): [] __schedule+0x298/0x1b0c kernel/sched/core.c:6460 softirqs last enabled at (1218): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (1218): [] release_sock+0x16c/0x1bc net/core/sock.c:3522 softirqs last disabled at (1214): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (1214): [] release_sock+0x34/0x1bc net/core/sock.c:3509 ---[ end trace 0000000000000000 ]--- Unable to handle kernel paging request at virtual address dfff800000000013 KASAN: null-ptr-deref in range [0x0000000000000098-0x000000000000009f] Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 [dfff800000000013] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 4322 Comm: kworker/u5:1 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci1 hci_rx_work pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] pc : do_raw_spin_lock+0x80/0x2f8 kernel/locking/spinlock_debug.c:114 lr : __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] lr : _raw_spin_lock_bh+0x5c/0x6c kernel/locking/spinlock.c:178 sp : ffff800020f97320 x29: ffff800020f973b0 x28: 1fffe0001e864e06 x27: ffff0000f4327030 x26: dfff800000000000 x25: 1fffe0001e864e04 x24: 1fffe0001e864e00 x23: dfff800000000000 x22: ffff7000041f2e68 x21: 0000000000000000 x20: 000000000000009c x19: 0000000000000098 x18: ffff800011b8bf60 x17: 203a657079742074 x16: ffff8000082eeb30 x15: 0000000000000002 x14: ffff60001e864e24 x13: 1fffe0001e864e24 x12: 0000000000100000 x11: ffff800020f97340 x10: ffff800014b11545 x9 : 0000000000000013 x8 : f3f3f3f8f1f1f1f1 x7 : 0000000000000000 x6 : ffff80000fd5f2cc x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff80001207b6c0 x0 : 0000000000000098 Call trace: debug_spin_lock_before kernel/locking/spinlock_debug.c:-1 [inline] do_raw_spin_lock+0x80/0x2f8 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] _raw_spin_lock_bh+0x5c/0x6c kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:356 [inline] lock_sock_nested+0x88/0x130 net/core/sock.c:3499 lock_sock include/net/sock.h:1805 [inline] l2cap_sock_ready_cb+0x4c/0x12c net/bluetooth/l2cap_sock.c:1697 l2cap_chan_ready net/bluetooth/l2cap_core.c:1411 [inline] l2cap_le_start+0x8f8/0x1028 net/bluetooth/l2cap_core.c:1523 l2cap_conn_ready net/bluetooth/l2cap_core.c:1793 [inline] l2cap_connect_cfm+0x57c/0xd98 net/bluetooth/l2cap_core.c:8366 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1814 le_conn_complete_evt+0xd30/0x1244 net/bluetooth/hci_event.c:5882 hci_le_conn_complete_evt+0x114/0x3f4 net/bluetooth/hci_event.c:5908 hci_le_meta_evt+0x2c0/0x4a0 net/bluetooth/hci_event.c:7101 hci_event_func net/bluetooth/hci_event.c:7412 [inline] hci_event_packet+0x6b8/0xf18 net/bluetooth/hci_event.c:7467 hci_rx_work+0x324/0xa80 net/bluetooth/hci_core.c:4083 process_one_work+0x7f8/0x13a4 kernel/workqueue.c:2292 worker_thread+0x8c4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Code: f2fe7e68 d343fe89 aa0003f3 f90002c8 (38f76928) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: f2fe7e68 movk x8, #0xf3f3, lsl #48 4: d343fe89 lsr x9, x20, #3 8: aa0003f3 mov x19, x0 c: f90002c8 str x8, [x22] * 10: 38f76928 ldrsb w8, [x9, x23] <-- trapping instruction