BUG: sleeping function called from invalid context at net/core/sock.c:3252 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3512, name: kworker/u5:3 6 locks held by kworker/u5:3/3512: #0: ffff888079b68938 ((wq_completion)hci2#2){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283 #1: ffffc90002e27d20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285 #2: ffff888078d8c078 (&hdev->lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0xab/0x9b0 net/bluetooth/hci_event.c:4471 #3: ffffffff8db318e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1507 [inline] #3: ffffffff8db318e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x45f/0x9b0 net/bluetooth/hci_event.c:4551 #4: ffff888013f8ec20 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #4: ffff888013f8ec20 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1116 [inline] #4: ffff888013f8ec20 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x27c/0xad0 net/bluetooth/sco.c:1201 #5: ffff888141bf4120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1676 [inline] #5: ffff888141bf4120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1129 [inline] #5: ffff888141bf4120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x456/0xad0 net/bluetooth/sco.c:1201 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 3512 Comm: kworker/u5:3 Not tainted 5.15.163-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci2 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 ___might_sleep+0x547/0x6a0 kernel/sched/core.c:9626 lock_sock_nested+0x5b/0x100 net/core/sock.c:3252 lock_sock include/net/sock.h:1676 [inline] sco_conn_ready net/bluetooth/sco.c:1129 [inline] sco_connect_cfm+0x456/0xad0 net/bluetooth/sco.c:1201 hci_connect_cfm include/net/bluetooth/hci_core.h:1510 [inline] hci_sync_conn_complete_evt+0x4ce/0x9b0 net/bluetooth/hci_event.c:4551 hci_event_packet+0xa12/0x1550 net/bluetooth/hci_event.c:6483 hci_rx_work+0x232/0x990 net/bluetooth/hci_core.c:5156 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x74/0x1ff0 kernel/locking/lockdep.c:4882 Read of size 8 at addr ffff888141bf40a0 by task kworker/u5:3/3512 CPU: 0 PID: 3512 Comm: kworker/u5:3 Tainted: G W 5.15.163-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: hci2 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 __lock_acquire+0x74/0x1ff0 kernel/locking/lockdep.c:4882 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:368 [inline] lock_sock_nested+0x68/0x100 net/core/sock.c:3253 lock_sock include/net/sock.h:1676 [inline] sco_conn_ready net/bluetooth/sco.c:1129 [inline] sco_connect_cfm+0x456/0xad0 net/bluetooth/sco.c:1201 hci_connect_cfm include/net/bluetooth/hci_core.h:1510 [inline] hci_sync_conn_complete_evt+0x4ce/0x9b0 net/bluetooth/hci_event.c:4551 hci_event_packet+0xa12/0x1550 net/bluetooth/hci_event.c:6483 hci_rx_work+0x232/0x990 net/bluetooth/hci_core.c:5156 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 3636: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xe0/0x200 net/core/sock.c:1863 sk_alloc+0x35/0x310 net/core/sock.c:1916 sco_sock_alloc net/bluetooth/sco.c:485 [inline] sco_sock_create+0xb7/0x300 net/bluetooth/sco.c:520 bt_sock_create+0x159/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x460/0x8d0 net/socket.c:1486 sock_create net/socket.c:1537 [inline] __sys_socket+0x132/0x370 net/socket.c:1579 __do_sys_socket net/socket.c:1588 [inline] __se_sys_socket net/socket.c:1586 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 3606: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 sk_prot_free net/core/sock.c:1899 [inline] __sk_destruct+0x58e/0x840 net/core/sock.c:1985 sco_sock_release+0x259/0x310 net/bluetooth/sco.c:1098 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1336 __fput+0x3fe/0x8e0 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888141bf4000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff888141bf4000, ffff888141bf4800) The buggy address belongs to the page: page:ffffea000506fc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x141bf0 head:ffffea000506fc00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000010200 dead000000000100 dead000000000122 ffff888011c42000 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 2416834950, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc_trace+0x1a0/0x290 mm/slub.c:3245 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] acpi_os_allocate_zeroed include/acpi/platform/aclinuxex.h:57 [inline] acpi_ds_create_walk_state+0xff/0x2a0 drivers/acpi/acpica/dswstate.c:518 acpi_ds_auto_serialize_method+0xe3/0x240 drivers/acpi/acpica/dsmethod.c:81 acpi_ds_init_one_object+0x1b7/0x360 drivers/acpi/acpica/dsinit.c:110 acpi_ns_walk_namespace+0x28c/0x4e0 acpi_ds_initialize_objects+0x195/0x2a0 drivers/acpi/acpica/dsinit.c:189 acpi_ns_load_table+0xf5/0x120 drivers/acpi/acpica/nsload.c:106 acpi_tb_load_namespace+0x289/0x6c0 drivers/acpi/acpica/tbxfload.c:158 acpi_load_tables+0x43/0x100 drivers/acpi/acpica/tbxfload.c:59 acpi_bus_init+0x97/0xad0 drivers/acpi/bus.c:1223 acpi_init+0xab/0x220 drivers/acpi/bus.c:1334 page_owner free stack trace missing Memory state around the buggy address: ffff888141bf3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888141bf4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888141bf4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888141bf4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888141bf4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================