================================================================== BUG: KASAN: use-after-free in l2cap_conn_ready net/bluetooth/l2cap_core.c:1782 [inline] BUG: KASAN: use-after-free in l2cap_connect_cfm+0x594/0xd64 net/bluetooth/l2cap_core.c:8365 Read of size 8 at addr ffff0000d11a3498 by task kworker/u5:7/4336 CPU: 1 PID: 4336 Comm: kworker/u5:7 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci2 hci_rx_work 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 l2cap_conn_ready net/bluetooth/l2cap_core.c:1782 [inline] l2cap_connect_cfm+0x594/0xd64 net/bluetooth/l2cap_core.c:8365 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc 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 4336: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] l2cap_chan_create+0x58/0x698 net/bluetooth/l2cap_core.c:469 l2cap_sock_alloc net/bluetooth/l2cap_sock.c:1926 [inline] l2cap_sock_new_connection_cb+0x164/0x284 net/bluetooth/l2cap_sock.c:1505 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8348 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc 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 9508: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] __kmem_cache_free+0xc0/0x224 mm/slub.c:3700 kfree+0xd0/0x1ac mm/slab_common.c:988 l2cap_chan_destroy net/bluetooth/l2cap_core.c:515 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x174/0x24c net/bluetooth/l2cap_core.c:539 l2cap_sock_cleanup_listen+0x104/0x28c net/bluetooth/l2cap_sock.c:1488 l2cap_sock_release+0x68/0x1c0 net/bluetooth/l2cap_sock.c:1446 __sock_release net/socket.c:654 [inline] sock_close+0xb4/0x1f8 net/socket.c:1400 __fput+0x1bc/0x7c0 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137 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/0x138 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:45 __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/0x954 kernel/rcu/tree.c:2849 __qdisc_destroy+0x2a8/0x500 net/sched/sch_generic.c:1084 qdisc_put net/sched/sch_generic.c:1104 [inline] shutdown_scheduler_queue+0x168/0x200 net/sched/sch_generic.c:1157 netdev_for_each_tx_queue include/linux/netdevice.h:2465 [inline] dev_shutdown+0x9c/0x47c net/sched/sch_generic.c:1489 unregister_netdevice_many+0x944/0x1740 net/core/dev.c:10981 unregister_netdevice_queue+0x2ac/0x2f8 net/core/dev.c:10921 unregister_netdevice include/linux/netdevice.h:3075 [inline] __tun_detach+0xb04/0x122c drivers/net/tun.c:685 tun_detach drivers/net/tun.c:701 [inline] tun_chr_close+0x118/0x1f8 drivers/net/tun.c:3492 __fput+0x1bc/0x7c0 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137 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/0x138 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 Second to last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __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/0x954 kernel/rcu/tree.c:2849 netlink_release+0x1260/0x1710 net/netlink/af_netlink.c:799 __sock_release net/socket.c:654 [inline] sock_close+0xb4/0x1f8 net/socket.c:1400 __fput+0x1bc/0x7c0 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137 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/0x138 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 ffff0000d11a3000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1176 bytes inside of 2048-byte region [ffff0000d11a3000, ffff0000d11a3800) The buggy address belongs to the physical page: page:000000001b241392 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1111a0 head:000000001b241392 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002900 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d11a3380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d11a3400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d11a3480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d11a3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d11a3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Unable to handle kernel paging request at virtual address fbd51fffffffff90 KASAN: maybe wild-memory-access in range [0xdeacfffffffffc80-0xdeacfffffffffc87] Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 [fbd51fffffffff90] address between user and kernel address ranges Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 4336 Comm: kworker/u5:7 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Workqueue: hci2 hci_rx_work pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : atomic_read include/linux/atomic/atomic-instrumented.h:28 [inline] pc : l2cap_chan_lock include/net/bluetooth/l2cap.h:863 [inline] pc : l2cap_conn_ready net/bluetooth/l2cap_core.c:1784 [inline] pc : l2cap_connect_cfm+0x4fc/0xd64 net/bluetooth/l2cap_core.c:8365 lr : instrument_atomic_read include/linux/instrumented.h:72 [inline] lr : atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] lr : l2cap_chan_lock include/net/bluetooth/l2cap.h:863 [inline] lr : l2cap_conn_ready net/bluetooth/l2cap_core.c:1784 [inline] lr : l2cap_connect_cfm+0x4f0/0xd64 net/bluetooth/l2cap_core.c:8365 sp : ffff800020de7600 x29: ffff800020de7680 x28: dfff800000000000 x27: 1fffe00019b1b007 x26: 0000000000000001 x25: 0000000000000080 x24: deacfffffffffc84 x23: ffff0000c375701a x22: dead000000000100 x21: ffff0000c3757260 x20: ffff0000cd8d8039 x19: ffff0000c3757000 x18: ffff800011abbcc0 x17: 0000000000000000 x16: ffff800008042d90 x15: 0000000000000002 x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000100000 x11: 0000000000062997 x10: ffff80003195b000 x9 : 0000000000000007 x8 : 1bd59fffffffff90 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800020de6fd8 x4 : ffff8000151a4920 x3 : ffff800010c09798 x2 : 0000000000000000 x1 : 0000000000000004 x0 : 0000000000000001 Call trace: atomic_read include/linux/atomic/atomic-instrumented.h:28 [inline] l2cap_chan_lock include/net/bluetooth/l2cap.h:863 [inline] l2cap_conn_ready net/bluetooth/l2cap_core.c:1784 [inline] l2cap_connect_cfm+0x4fc/0xd64 net/bluetooth/l2cap_core.c:8365 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Code: 97cfa459 d343ff08 12000b09 11000d29 (38fc6908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 97cfa459 bl 0xffffffffff3e9164 4: d343ff08 lsr x8, x24, #3 8: 12000b09 and w9, w24, #0x7 c: 11000d29 add w9, w9, #0x3 * 10: 38fc6908 ldrsb w8, [x8, x28] <-- trapping instruction