BUG: sleeping function called from invalid context at net/core/sock.c:3545 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5129, name: kworker/u9:1 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 6 locks held by kworker/u9:1/5129: #0: ffff0000c32c2148 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x624/0x15b8 kernel/workqueue.c:3205 #1: ffff8000980b7c20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x6a0/0x15b8 kernel/workqueue.c:3205 #2: ffff0000d5108078 (&hdev->lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0xa4/0x870 net/bluetooth/hci_event.c:4925 #3: ffff80008fbbb548 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1962 [inline] #3: ffff80008fbbb548 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x3d4/0x870 net/bluetooth/hci_event.c:5008 #4: ffff0000d3b64620 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #4: ffff0000d3b64620 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1277 [inline] #4: ffff0000d3b64620 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x260/0x94c net/bluetooth/sco.c:1362 #5: ffff0000d69ab258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1607 [inline] #5: ffff0000d69ab258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1290 [inline] #5: ffff0000d69ab258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x3e8/0x94c net/bluetooth/sco.c:1362 Preemption disabled at: [] spin_lock include/linux/spinlock.h:351 [inline] [] sco_conn_ready net/bluetooth/sco.c:1277 [inline] [] sco_connect_cfm+0x260/0x94c net/bluetooth/sco.c:1362 CPU: 1 PID: 5129 Comm: kworker/u9:1 Not tainted 6.10.0-syzkaller-09675-g12cc3d5389f3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: hci0 hci_rx_work Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 dump_stack+0x1c/0x28 lib/dump_stack.c:123 __might_resched+0x374/0x4d0 kernel/sched/core.c:8437 __might_sleep+0x90/0xe4 kernel/sched/core.c:8366 lock_sock_nested+0x6c/0x11c net/core/sock.c:3545 lock_sock include/net/sock.h:1607 [inline] sco_conn_ready net/bluetooth/sco.c:1290 [inline] sco_connect_cfm+0x3e8/0x94c net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x438/0x870 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x8dc/0x106c net/bluetooth/hci_event.c:7497 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4029 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x938/0xebc kernel/workqueue.c:3390 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 ================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x10c/0x779c kernel/locking/lockdep.c:5007 Read of size 8 at addr ffff0000d69ab1d8 by task kworker/u9:1/5129 CPU: 1 PID: 5129 Comm: kworker/u9:1 Tainted: G W 6.10.0-syzkaller-09675-g12cc3d5389f3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: hci0 hci_rx_work Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x178/0x518 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 __lock_acquire+0x10c/0x779c kernel/locking/lockdep.c:5007 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __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:3546 lock_sock include/net/sock.h:1607 [inline] sco_conn_ready net/bluetooth/sco.c:1290 [inline] sco_connect_cfm+0x3e8/0x94c net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x438/0x870 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x8dc/0x106c net/bluetooth/hci_event.c:7497 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4029 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x938/0xebc kernel/workqueue.c:3390 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 6449: 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:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x90/0xa8 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4149 [inline] __kmalloc_noprof+0x2a0/0x464 mm/slub.c:4161 kmalloc_noprof include/linux/slab.h:685 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:2096 sk_alloc+0x40/0x3cc net/core/sock.c:2149 bt_sock_alloc+0x4c/0x304 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:500 [inline] sco_sock_create+0xbc/0x31c net/bluetooth/sco.c:531 bt_sock_create+0x14c/0x248 net/bluetooth/af_bluetooth.c:132 __sock_create+0x43c/0x884 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x134/0x340 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __arm64_sys_socket+0x7c/0x94 net/socket.c:1718 __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:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 6448: 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:579 poison_slab_object+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x1c/0x48 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2235 [inline] slab_free mm/slub.c:4464 [inline] kfree+0x13c/0x3bc mm/slub.c:4585 sk_prot_free net/core/sock.c:2132 [inline] __sk_destruct+0x4a4/0x730 net/core/sock.c:2224 sk_destruct net/core/sock.c:2239 [inline] __sk_free+0x388/0x4f4 net/core/sock.c:2250 sk_free+0x60/0xc8 net/core/sock.c:2261 sock_put include/net/sock.h:1884 [inline] sco_sock_kill+0xfc/0x1b4 net/bluetooth/sco.c:431 sco_sock_release+0x1fc/0x2c0 net/bluetooth/sco.c:1259 __sock_release net/socket.c:659 [inline] sock_close+0xa4/0x1e8 net/socket.c:1421 __fput+0x1bc/0x774 fs/file_table.c:422 ____fput+0x20/0x30 fs/file_table.c:450 task_work_run+0x230/0x2e0 kernel/task_work.c:222 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:713 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000d69ab000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 472 bytes inside of freed 2048-byte region [ffff0000d69ab000, ffff0000d69ab800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1169a8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 05ffc00000000040 ffff0000c0002000 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000080008 00000001ffffefff 0000000000000000 head: 05ffc00000000040 ffff0000c0002000 dead000000000100 dead000000000122 head: 0000000000000000 0000000000080008 00000001ffffefff 0000000000000000 head: 05ffc00000000003 fffffdffc35a6a01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d69ab080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d69ab100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d69ab180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d69ab200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d69ab280: 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 PID: 5129 Comm: kworker/u9:1 Tainted: G B W 6.10.0-syzkaller-09675-g12cc3d5389f3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: hci0 hci_rx_work pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : apparmor_sk_clone_security+0xe8/0x390 security/apparmor/lsm.c:1096 lr : apparmor_sk_clone_security+0xc8/0x390 security/apparmor/lsm.c:1094 sp : ffff8000980b7730 x29: ffff8000980b7730 x28: 1ffff00013016ef8 x27: dfff800000000000 x26: 1fffe0001ad356a2 x25: ffff0000c99e53c4 x24: 1fffe000190ebf34 x23: dfff800000000000 x22: dfff800000000000 x21: 0000000000000000 x20: 0000000000000000 x19: ffff0000c875f9a0 x18: ffff800080017b48 x17: ffff800089335714 x16: ffff800080a4d6dc x15: 0000000000000001 x14: 1ffff00011f7b045 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000002 x10: 0000000000ff0100 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : ffff8000892060e4 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff8000828c0c6c x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000 Call trace: apparmor_sk_clone_security+0xe8/0x390 security/apparmor/lsm.c:1096 security_sk_clone+0x58/0x9c security/security.c:4712 sco_sock_init net/bluetooth/sco.c:485 [inline] sco_conn_ready net/bluetooth/sco.c:1300 [inline] sco_connect_cfm+0x57c/0x94c net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x438/0x870 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x8dc/0x106c net/bluetooth/hci_event.c:7497 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4029 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x938/0xebc kernel/workqueue.c:3390 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Code: 710006df 5400102b 97721917 d343fe88 (38776908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 710006df cmp w22, #0x1 4: 5400102b b.lt 0x208 // b.tstop 8: 97721917 bl 0xfffffffffdc86464 c: d343fe88 lsr x8, x20, #3 * 10: 38776908 ldrb w8, [x8, x23] <-- trapping instruction