BUG: sleeping function called from invalid context at net/core/sock.c:3258
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4285, name: kworker/u5:2
5 locks held by kworker/u5:2/4285:
#0: ffff888075ef7938 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x760/0x1000 kernel/workqueue.c:-1
#1: ffffc9000315fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7a3/0x1000 kernel/workqueue.c:2285
#2: ffffffff8d37ece8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm+0x2c/0x130 include/net/bluetooth/hci_core.h:1502
#3: ffff888029bbf820 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:364 [inline]
#3: ffff888029bbf820 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1119 [inline]
#3: ffff888029bbf820 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x26c/0xa40 net/bluetooth/sco.c:1204
#4: ffff88807c403120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1730 [inline]
#4: ffff88807c403120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1132 [inline]
#4: ffff88807c403120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x464/0xa40 net/bluetooth/sco.c:1204
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 4285 Comm: kworker/u5:2 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: hci0 hci_rx_work
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
___might_sleep+0x47c/0x600 kernel/sched/core.c:9658
lock_sock_nested+0x5b/0x100 net/core/sock.c:3258
lock_sock include/net/sock.h:1730 [inline]
sco_conn_ready net/bluetooth/sco.c:1132 [inline]
sco_connect_cfm+0x464/0xa40 net/bluetooth/sco.c:1204
hci_connect_cfm+0x8f/0x130 include/net/bluetooth/hci_core.h:1505
hci_conn_request_evt+0x6a2/0x9f0 net/bluetooth/hci_event.c:2914
hci_event_packet+0x743/0x12f0 net/bluetooth/hci_event.c:6405
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff88807c4030a0 by task kworker/u5:2/4285
CPU: 0 PID: 4285 Comm: kworker/u5:2 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: hci0 hci_rx_work
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
__lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x32/0x50 kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:369 [inline]
lock_sock_nested+0x68/0x100 net/core/sock.c:3259
lock_sock include/net/sock.h:1730 [inline]
sco_conn_ready net/bluetooth/sco.c:1132 [inline]
sco_connect_cfm+0x464/0xa40 net/bluetooth/sco.c:1204
hci_connect_cfm+0x8f/0x130 include/net/bluetooth/hci_core.h:1505
hci_conn_request_evt+0x6a2/0x9f0 net/bluetooth/hci_event.c:2914
hci_event_packet+0x743/0x12f0 net/bluetooth/hci_event.c:6405
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 5043:
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 mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
kmalloc include/linux/slab.h:612 [inline]
sk_prot_alloc+0xe7/0x210 net/core/sock.c:1866
sk_alloc+0x2f/0x310 net/core/sock.c:1922
sco_sock_alloc net/bluetooth/sco.c:491 [inline]
sco_sock_create+0xba/0x300 net/bluetooth/sco.c:526
bt_sock_create+0x155/0x220 net/bluetooth/af_bluetooth.c:130
__sock_create+0x47b/0x900 net/socket.c:1486
sock_create net/socket.c:1542 [inline]
__sys_socket+0xe2/0x170 net/socket.c:1584
__do_sys_socket net/socket.c:1593 [inline]
__se_sys_socket net/socket.c:1591 [inline]
__x64_sys_socket+0x76/0x80 net/socket.c:1591
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 5042:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
sk_prot_free net/core/sock.c:1905 [inline]
__sk_destruct+0x578/0x840 net/core/sock.c:1991
sco_sock_release+0x254/0x310 net/bluetooth/sco.c:1101
__sock_release net/socket.c:649 [inline]
sock_close+0xd5/0x240 net/socket.c:1336
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff88807c403000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 160 bytes inside of
2048-byte region [ffff88807c403000, ffff88807c403800)
The buggy address belongs to the page:
page:ffffea0001f10000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c400
head:ffffea0001f10000 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016842000
raw: 0000000000000000 0000000000080008 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4240, ts 75223318414, free_ts 75222563905
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
alloc_slab_page mm/slub.c:1780 [inline]
allocate_slab mm/slub.c:1917 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1980
___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc+0x1cd/0x330 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
kzalloc include/linux/slab.h:738 [inline]
__register_sysctl_table+0xe0/0x1230 fs/proc/proc_sysctl.c:1324
__devinet_sysctl_register+0x2c1/0x380 net/ipv4/devinet.c:2603
devinet_sysctl_register+0x17c/0x1f0 net/ipv4/devinet.c:2643
inetdev_init+0x28c/0x4d0 net/ipv4/devinet.c:277
inetdev_event+0x280/0x1360 net/ipv4/devinet.c:1543
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers net/core/dev.c:2075 [inline]
register_netdevice+0x1275/0x16b0 net/core/dev.c:10428
__ip_tunnel_create+0x2bf/0x380 net/ipv4/ip_tunnel.c:267
ip_tunnel_init_net+0x232/0x6b0 net/ipv4/ip_tunnel.c:1098
ops_init+0x357/0x600 net/core/net_namespace.c:138
setup_net+0x38d/0x9f0 net/core/net_namespace.c:333
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x94/0x280 mm/page_alloc.c:3396
free_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc_trace+0x103/0x2a0 mm/slub.c:3250
kmalloc include/linux/slab.h:607 [inline]
kzalloc include/linux/slab.h:738 [inline]
kset_create lib/kobject.c:982 [inline]
kset_create_and_add+0x56/0x160 lib/kobject.c:1025
register_queue_kobjects net/core/net-sysfs.c:1759 [inline]
netdev_register_kobject+0x1a0/0x310 net/core/net-sysfs.c:2018
register_netdevice+0x1019/0x16b0 net/core/dev.c:10397
__ip_tunnel_create+0x2bf/0x380 net/ipv4/ip_tunnel.c:267
ip_tunnel_init_net+0x232/0x6b0 net/ipv4/ip_tunnel.c:1098
ops_init+0x357/0x600 net/core/net_namespace.c:138
setup_net+0x38d/0x9f0 net/core/net_namespace.c:333
Memory state around the buggy address:
ffff88807c402f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807c403000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807c403080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807c403100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807c403180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================