BUG: sleeping function called from invalid context at net/core/sock.c:3664 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6120, name: kworker/u9:2 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 5 locks held by kworker/u9:2/6120: #0: ffff0000d32ef948 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x674/0x1638 kernel/workqueue.c:3212 #1: ffff80009b5b7ba0 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x708/0x1638 kernel/workqueue.c:3212 #2: ffff0000d46f0078 (&hdev->lock){+.+.}-{4:4}, at: hci_sync_conn_complete_evt+0xe4/0x90c net/bluetooth/hci_event.c:4931 #3: ffff0000cc612c20 (&conn->lock#3){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #3: ffff0000cc612c20 (&conn->lock#3){+.+.}-{3:3}, at: sco_conn_ready net/bluetooth/sco.c:1328 [inline] #3: ffff0000cc612c20 (&conn->lock#3){+.+.}-{3:3}, at: sco_connect_cfm+0x24c/0x8f4 net/bluetooth/sco.c:1415 #4: ffff0000ce4a6258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1624 [inline] #4: ffff0000ce4a6258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1341 [inline] #4: ffff0000ce4a6258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x3d8/0x8f4 net/bluetooth/sco.c:1415 Preemption disabled at: [] spin_lock include/linux/spinlock.h:351 [inline] [] sco_conn_ready net/bluetooth/sco.c:1328 [inline] [] sco_connect_cfm+0x24c/0x8f4 net/bluetooth/sco.c:1415 CPU: 1 UID: 0 PID: 6120 Comm: kworker/u9:2 Not tainted 6.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: hci1 hci_rx_work Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 __might_resched+0x374/0x4d0 kernel/sched/core.c:8767 __might_sleep+0x90/0xe4 kernel/sched/core.c:8696 lock_sock_nested+0x6c/0x11c net/core/sock.c:3664 lock_sock include/net/sock.h:1624 [inline] sco_conn_ready net/bluetooth/sco.c:1341 [inline] sco_connect_cfm+0x3d8/0x8f4 net/bluetooth/sco.c:1415 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_sync_conn_complete_evt+0x4cc/0x90c net/bluetooth/hci_event.c:5014 hci_event_func net/bluetooth/hci_event.c:7473 [inline] hci_event_packet+0x8d0/0x1060 net/bluetooth/hci_event.c:7525 hci_rx_work+0x31c/0xb04 net/bluetooth/hci_core.c:4015 process_one_work+0x810/0x1638 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3400 kthread+0x5f8/0x744 kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 ================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x10c/0x7904 kernel/locking/lockdep.c:5091 Read of size 8 at addr ffff0000ce4a61d8 by task kworker/u9:2/6120 CPU: 1 UID: 0 PID: 6120 Comm: kworker/u9:2 Tainted: G W 6.14.0-rc6-syzkaller #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: hci1 hci_rx_work Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (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:408 [inline] print_report+0x178/0x530 mm/kasan/report.c:521 kasan_report+0xd8/0x138 mm/kasan/report.c:634 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __lock_acquire+0x10c/0x7904 kernel/locking/lockdep.c:5091 lock_acquire+0x23c/0x724 kernel/locking/lockdep.c:5851 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x48/0x60 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:356 [inline] lock_sock_nested+0x74/0x11c net/core/sock.c:3665 lock_sock include/net/sock.h:1624 [inline] sco_conn_ready net/bluetooth/sco.c:1341 [inline] sco_connect_cfm+0x3d8/0x8f4 net/bluetooth/sco.c:1415 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_sync_conn_complete_evt+0x4cc/0x90c net/bluetooth/hci_event.c:5014 hci_event_func net/bluetooth/hci_event.c:7473 [inline] hci_event_packet+0x8d0/0x1060 net/bluetooth/hci_event.c:7525 hci_rx_work+0x31c/0xb04 net/bluetooth/hci_core.c:4015 process_one_work+0x810/0x1638 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3400 kthread+0x5f8/0x744 kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 7110: 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:562 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_noprof+0x32c/0x54c mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:2181 sk_alloc+0x44/0x3fc net/core/sock.c:2234 bt_sock_alloc+0x4c/0x304 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:552 [inline] sco_sock_create+0xbc/0x31c net/bluetooth/sco.c:583 bt_sock_create+0x14c/0x248 net/bluetooth/af_bluetooth.c:132 __sock_create+0x448/0x908 net/socket.c:1548 sock_create net/socket.c:1606 [inline] __sys_socket_create net/socket.c:1643 [inline] __sys_socket+0x134/0x340 net/socket.c:1690 __do_sys_socket net/socket.c:1704 [inline] __se_sys_socket net/socket.c:1702 [inline] __arm64_sys_socket+0x7c/0x94 net/socket.c:1702 __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 7109: 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:576 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:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x180/0x478 mm/slub.c:4757 sk_prot_free net/core/sock.c:2217 [inline] __sk_destruct+0x4b8/0x758 net/core/sock.c:2312 sk_destruct net/core/sock.c:2340 [inline] __sk_free+0x388/0x4f4 net/core/sock.c:2351 sk_free+0x60/0xc8 net/core/sock.c:2362 sock_put include/net/sock.h:1914 [inline] sco_sock_kill+0xfc/0x1b4 net/bluetooth/sco.c:494 sco_sock_release+0x1fc/0x2c0 net/bluetooth/sco.c:1310 __sock_release net/socket.c:647 [inline] sock_close+0xa4/0x1e8 net/socket.c:1398 __fput+0x340/0x760 fs/file_table.c:464 ____fput+0x20/0x30 fs/file_table.c:492 task_work_run+0x230/0x2e0 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] do_notify_resume+0x178/0x1f4 arch/arm64/kernel/entry-common.c:151 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xac/0x168 arch/arm64/kernel/entry-common.c:745 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000ce4a6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 472 bytes inside of freed 2048-byte region [ffff0000ce4a6000, ffff0000ce4a6800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e4a0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c0002000 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c0002000 0000000000000000 dead000000000001 head: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc3392801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ce4a6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ce4a6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000ce4a6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ce4a6200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ce4a6280: 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 dfff800000000000 KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] Mem abort info: ESR = 0x0000000096000005 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x05: level 1 translation fault Data abort info: ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [dfff800000000000] address between user and kernel address ranges Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP Modules linked in: CPU: 1 UID: 0 PID: 6120 Comm: kworker/u9:2 Tainted: G B W 6.14.0-rc6-syzkaller #0 Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: hci1 hci_rx_work pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : apparmor_sk_clone_security+0xf8/0x3a0 security/apparmor/lsm.c:1085 lr : apparmor_sk_clone_security+0xd8/0x3a0 security/apparmor/lsm.c:1083 sp : ffff80009b5b7620 x29: ffff80009b5b7620 x28: 1ffff000136b6ed4 x27: dfff800000000000 x26: 1fffe00019c94cad x25: ffff0000c9d4d3c4 x24: 1fffe000184eb79c x23: dfff800000000000 x22: 0000000000000000 x21: 0000000000000000 x20: 0000000000000000 x19: ffff0000c275bce0 x18: ffff800080017b68 x17: ffff800080365f90 x16: ffff800080bec7b0 x15: 0000000000000001 x14: 1ffff0001229c2d9 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000002 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : ffff800089e78964 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff800082b4167c x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000 Call trace: apparmor_sk_clone_security+0xf8/0x3a0 security/apparmor/lsm.c:1085 (P) security_sk_clone+0x90/0x194 security/security.c:4887 sco_sock_init net/bluetooth/sco.c:537 [inline] sco_conn_ready net/bluetooth/sco.c:1351 [inline] sco_connect_cfm+0x56c/0x8f4 net/bluetooth/sco.c:1415 hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline] hci_sync_conn_complete_evt+0x4cc/0x90c net/bluetooth/hci_event.c:5014 hci_event_func net/bluetooth/hci_event.c:7473 [inline] hci_event_packet+0x8d0/0x1060 net/bluetooth/hci_event.c:7525 hci_rx_work+0x31c/0xb04 net/bluetooth/hci_core.c:4015 process_one_work+0x810/0x1638 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3400 kthread+0x5f8/0x744 kernel/kthread.c:464 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Code: 710006df 5400102b 976cef3c d343fe88 (38776908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 710006df cmp w22, #0x1 4: 5400102b b.lt 0x208 // b.tstop 8: 976cef3c bl 0xfffffffffdb3bcf8 c: d343fe88 lsr x8, x20, #3 * 10: 38776908 ldrb w8, [x8, x23] <-- trapping instruction