BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 6415, name: kworker/u9:5 preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 4 locks held by kworker/u9:5/6415: #0: ffff0000d5908148 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x624/0x15b8 kernel/workqueue.c:3205 #1: ffff8000990a7c20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x6a0/0x15b8 kernel/workqueue.c:3205 #2: ffff0000e17ec078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xc0/0x998 net/bluetooth/hci_event.c:6853 #3: ffff80008f6edb60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:325 CPU: 0 UID: 0 PID: 6415 Comm: kworker/u9:5 Not tainted 6.11.0-rc4-syzkaller-gbe6d853c7631 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci1 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:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 __might_resched+0x374/0x4d0 kernel/sched/core.c:8463 __might_sleep+0x90/0xe4 kernel/sched/core.c:8392 __mutex_lock_common+0xcc/0x21a0 kernel/locking/mutex.c:585 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 hci_connect_cfm include/net/bluetooth/hci_core.h:1962 [inline] hci_le_create_big_complete_evt+0x348/0x998 net/bluetooth/hci_event.c:6878 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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: Invalid wait context ] 6.11.0-rc4-syzkaller-gbe6d853c7631 #0 Tainted: G W ----------------------------- kworker/u9:5/6415 is trying to lock: ffff800092518908 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1962 [inline] ffff800092518908 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0x348/0x998 net/bluetooth/hci_event.c:6878 other info that might help us debug this: context-{4:4} 4 locks held by kworker/u9:5/6415: #0: ffff0000d5908148 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x624/0x15b8 kernel/workqueue.c:3205 #1: ffff8000990a7c20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x6a0/0x15b8 kernel/workqueue.c:3205 #2: ffff0000e17ec078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xc0/0x998 net/bluetooth/hci_event.c:6853 #3: ffff80008f6edb60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:325 stack backtrace: CPU: 1 UID: 0 PID: 6415 Comm: kworker/u9:5 Tainted: G W 6.11.0-rc4-syzkaller-gbe6d853c7631 #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci1 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:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 print_lock_invalid_wait_context kernel/locking/lockdep.c:4750 [inline] check_wait_context kernel/locking/lockdep.c:4820 [inline] __lock_acquire+0x1f30/0x779c kernel/locking/lockdep.c:5092 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 hci_connect_cfm include/net/bluetooth/hci_core.h:1962 [inline] hci_le_create_big_complete_evt+0x348/0x998 net/bluetooth/hci_event.c:6878 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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 hci_le_create_big_complete_evt+0x300/0x998 Read of size 8 at addr ffff0000cedf4000 by task kworker/u9:5/6415 CPU: 1 UID: 0 PID: 6415 Comm: kworker/u9:5 Tainted: G W 6.11.0-rc4-syzkaller-gbe6d853c7631 #0 Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci1 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:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 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 hci_le_create_big_complete_evt+0x300/0x998 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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 6415: 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+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x244/0x374 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] __hci_conn_add+0x25c/0x13cc net/bluetooth/hci_conn.c:934 hci_conn_add+0x70/0x88 net/bluetooth/hci_conn.c:1052 hci_le_big_sync_established_evt+0x360/0x9ec net/bluetooth/hci_event.c:6923 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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 Freed by task 6415: 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+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x154/0x3e0 mm/slub.c:4594 bt_link_release+0x20/0x30 net/bluetooth/hci_sysfs.c:16 device_release+0x8c/0x1ac kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2a8/0x41c lib/kobject.c:737 put_device+0x28/0x40 drivers/base/core.c:3790 hci_conn_del_sysfs+0x7c/0x170 net/bluetooth/hci_sysfs.c:72 hci_conn_cleanup net/bluetooth/hci_conn.c:175 [inline] hci_conn_del+0x72c/0xaa0 net/bluetooth/hci_conn.c:1162 hci_le_create_big_complete_evt+0x55c/0x998 net/bluetooth/hci_event.c:6880 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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 The buggy address belongs to the object at ffff0000cedf4000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 0 bytes inside of freed 8192-byte region [ffff0000cedf4000, ffff0000cedf6000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10edf0 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: 0xfdffffff(slab) raw: 05ffc00000000040 ffff0000c0002280 fffffdffc35c6000 dead000000000004 raw: 0000000000000000 0000000080020002 00000001fdffffff 0000000000000000 head: 05ffc00000000040 ffff0000c0002280 fffffdffc35c6000 dead000000000004 head: 0000000000000000 0000000080020002 00000001fdffffff 0000000000000000 head: 05ffc00000000003 fffffdffc33b7c01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cedf3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000cedf3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000cedf4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cedf4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cedf4100: 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 dfff800000000002 KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] 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 [dfff800000000002] address between user and kernel address ranges Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP Modules linked in: CPU: 1 UID: 0 PID: 6415 Comm: kworker/u9:5 Tainted: G B W 6.11.0-rc4-syzkaller-gbe6d853c7631 #0 Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci1 hci_rx_work pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : memcmp lib/string.c:676 [inline] pc : bcmp+0x134/0x1c8 lib/string.c:697 lr : bacmp include/net/bluetooth/bluetooth.h:366 [inline] lr : hci_le_create_big_complete_evt+0x210/0x998 net/bluetooth/hci_event.c:6858 sp : ffff8000990a7710 x29: ffff8000990a7720 x28: ffff800092518880 x27: 1ffff00013214ef4 x26: ffff0000d45b103b x25: dfff800000000000 x24: dfff800000000000 x23: ffff8000990a77c0 x22: 0000000000000014 x21: 0000000000000014 x20: ffff8000990a77c0 x19: 0000000000000006 x18: 1fffe0003679e7e6 x17: ffff80008f50d000 x16: ffff80008b22dc80 x15: ffff700013214ef8 x14: 1ffff00013214ef8 x13: 0000000000000006 x12: ffffffffffffffff x11: ffff700013214ef8 x10: 1ffff00013214ef8 x9 : 0000000000000004 x8 : 0000000000000002 x7 : 0000000000000000 x6 : ffff8000802b5e54 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80008a460078 x2 : 0000000000000006 x1 : ffff8000990a77c0 x0 : 0000000000000014 Call trace: memcmp lib/string.c:676 [inline] bcmp+0x134/0x1c8 lib/string.c:697 bacmp include/net/bluetooth/bluetooth.h:366 [inline] hci_le_create_big_complete_evt+0x210/0x998 net/bluetooth/hci_event.c:6858 hci_le_meta_evt+0x2a4/0x478 net/bluetooth/hci_event.c:7135 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x890/0x106c net/bluetooth/hci_event.c:7498 hci_rx_work+0x318/0xa80 net/bluetooth/hci_core.c:4022 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: aa1503f6 aa1403f7 d343fea8 12000aa9 (38f86908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: aa1503f6 mov x22, x21 4: aa1403f7 mov x23, x20 8: d343fea8 lsr x8, x21, #3 c: 12000aa9 and w9, w21, #0x7 * 10: 38f86908 ldrsb w8, [x8, x24] <-- trapping instruction