======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u5:5/4195 is trying to acquire lock:
ffff888024898120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1731 [inline]
ffff888024898120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1120 [inline]
ffff888024898120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x148/0xa60 net/bluetooth/sco.c:1211
but task is already holding lock:
ffffffff8d57a7e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1502 [inline]
ffffffff8d57a7e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_complete_evt+0xd19/0x1470 net/bluetooth/hci_event.c:2796
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (hci_cb_list_lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
hci_connect_cfm include/net/bluetooth/hci_core.h:1502 [inline]
hci_remote_features_evt+0x5f5/0xa40 net/bluetooth/hci_event.c:3369
hci_event_packet+0x63a/0x1370 net/bluetooth/hci_event.c:6446
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
-> #1 (&hdev->lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
sco_sock_connect+0x18f/0x910 net/bluetooth/sco.c:604
__sys_connect_file net/socket.c:1933 [inline]
__sys_connect+0x3cb/0x450 net/socket.c:1950
__do_sys_connect net/socket.c:1960 [inline]
__se_sys_connect net/socket.c:1957 [inline]
__x64_sys_connect+0x76/0x80 net/socket.c:1957
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
-> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
lock_sock_nested+0x44/0x100 net/core/sock.c:3259
lock_sock include/net/sock.h:1731 [inline]
sco_conn_ready net/bluetooth/sco.c:1120 [inline]
sco_connect_cfm+0x148/0xa60 net/bluetooth/sco.c:1211
hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline]
hci_conn_complete_evt+0xd83/0x1470 net/bluetooth/hci_event.c:2796
hci_event_packet+0x900/0x1370 net/bluetooth/hci_event.c:6418
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
other info that might help us debug this:
Chain exists of:
sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(hci_cb_list_lock);
lock(&hdev->lock);
lock(hci_cb_list_lock);
lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO);
*** DEADLOCK ***
4 locks held by kworker/u5:5/4195:
#0: ffff8880247ab138 ((wq_completion)hci4#2){+.+.}-{0:0}, at: process_one_work+0x761/0x1010 kernel/workqueue.c:-1
#1: ffffc90002fdfd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x79f/0x1010 kernel/workqueue.c:2285
#2: ffff8880796e4078 (&hdev->lock){+.+.}-{3:3}, at: hci_conn_complete_evt+0xc4/0x1470 net/bluetooth/hci_event.c:2672
#3: ffffffff8d57a7e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1502 [inline]
#3: ffffffff8d57a7e8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_complete_evt+0xd19/0x1470 net/bluetooth/hci_event.c:2796
stack backtrace:
CPU: 0 PID: 4195 Comm: kworker/u5:5 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: hci4 hci_rx_work
Call Trace:
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
lock_sock_nested+0x44/0x100 net/core/sock.c:3259
lock_sock include/net/sock.h:1731 [inline]
sco_conn_ready net/bluetooth/sco.c:1120 [inline]
sco_connect_cfm+0x148/0xa60 net/bluetooth/sco.c:1211
hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline]
hci_conn_complete_evt+0xd83/0x1470 net/bluetooth/hci_event.c:2796
hci_event_packet+0x900/0x1370 net/bluetooth/hci_event.c:6418
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
BUG: KASAN: use-after-free in do_raw_spin_lock+0x283/0x2f0 kernel/locking/spinlock_debug.c:114
Read of size 4 at addr ffff88802489808c by task kworker/u5:5/4195
CPU: 1 PID: 4195 Comm: kworker/u5:5 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: hci4 hci_rx_work
Call Trace:
dump_stack_lvl+0x188/0x250 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
debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
do_raw_spin_lock+0x283/0x2f0 kernel/locking/spinlock_debug.c:114
spin_lock_bh include/linux/spinlock.h:369 [inline]
lock_sock_nested+0x68/0x100 net/core/sock.c:3262
lock_sock include/net/sock.h:1731 [inline]
sco_conn_ready net/bluetooth/sco.c:1120 [inline]
sco_connect_cfm+0x148/0xa60 net/bluetooth/sco.c:1211
hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline]
hci_conn_complete_evt+0xd83/0x1470 net/bluetooth/hci_event.c:2796
hci_event_packet+0x900/0x1370 net/bluetooth/hci_event.c:6418
hci_rx_work+0x255/0xa10 net/bluetooth/hci_core.c:5160
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 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 6365:
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:498 [inline]
sco_sock_create+0xba/0x300 net/bluetooth/sco.c:533
bt_sock_create+0x155/0x220 net/bluetooth/af_bluetooth.c:130
__sock_create+0x47b/0x900 net/socket.c:1496
sock_create net/socket.c:1552 [inline]
__sys_socket+0xe2/0x170 net/socket.c:1594
__do_sys_socket net/socket.c:1603 [inline]
__se_sys_socket net/socket.c:1601 [inline]
__x64_sys_socket+0x76/0x80 net/socket.c:1601
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 6369:
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:1108
__sock_release net/socket.c:651 [inline]
sock_close+0xd5/0x240 net/socket.c:1346
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
get_signal+0x1222/0x12c0 kernel/signal.c:2672
arch_do_signal_or_restart+0xe7/0x12c0 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:154 [inline]
exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
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 ffff888024898000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 140 bytes inside of
2048-byte region [ffff888024898000, ffff888024898800)
The buggy address belongs to the page:
page:ffffea0000922600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24898
head:ffffea0000922600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001ddac00 0000000200000002 ffff888016c42000
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 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5750, ts 217963493183, free_ts 217928064169
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 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+0x80a/0xdd0 mm/slub.c:3013
__slab_alloc mm/slub.c:3100 [inline]
slab_alloc_node mm/slub.c:3191 [inline]
__kmalloc_node_track_caller+0x1fc/0x3a0 mm/slub.c:4963
kmalloc_reserve net/core/skbuff.c:356 [inline]
pskb_expand_head+0x127/0x10f0 net/core/skbuff.c:1709
netlink_trim+0x180/0x220 net/netlink/af_netlink.c:1299
netlink_broadcast_filtered+0x7c/0x1170 net/netlink/af_netlink.c:1511
netlink_broadcast net/netlink/af_netlink.c:1556 [inline]
nlmsg_multicast include/net/netlink.h:1033 [inline]
nlmsg_notify+0xec/0x1a0 net/netlink/af_netlink.c:2550
rtnl_notify net/core/rtnetlink.c:761 [inline]
rtmsg_ifinfo_send net/core/rtnetlink.c:3910 [inline]
rtmsg_ifinfo_event net/core/rtnetlink.c:3925 [inline]
rtnetlink_event+0x13a/0x1a0 net/core/rtnetlink.c:5735
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
netdev_lower_state_changed+0xd1/0x150 net/core/dev.c:8606
team_lower_state_changed drivers/net/team/team.c:89 [inline]
team_port_enable+0xa71/0xce0 drivers/net/team/team.c:947
team_port_add drivers/net/team/team.c:1292 [inline]
team_add_slave+0x20ec/0x26e0 drivers/net/team/team.c:1990
do_set_master net/core/rtnetlink.c:2577 [inline]
do_setlink+0xe90/0x3d60 net/core/rtnetlink.c:2788
__rtnl_newlink net/core/rtnetlink.c:3452 [inline]
rtnl_newlink+0x1658/0x1a50 net/core/rtnetlink.c:3574
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+0x8f/0x2a0 mm/page_alloc.c:3396
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]
__kmalloc+0x127/0x330 mm/slub.c:4408
kmalloc include/linux/slab.h:612 [inline]
kzalloc include/linux/slab.h:738 [inline]
fib6_info_alloc+0x2e/0xe0 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x44f/0x1210 net/ipv6/route.c:3769
ip6_route_add+0x24/0x130 net/ipv6/route.c:3865
addrconf_prefix_route net/ipv6/addrconf.c:2446 [inline]
add_v4_addrs+0x930/0xcc0 net/ipv6/addrconf.c:3193
addrconf_sit_config net/ipv6/addrconf.c:3441 [inline]
addrconf_init_auto_addrs+0x39a/0xb00 net/ipv6/addrconf.c:3479
addrconf_notify+0xa6b/0xf00 net/ipv6/addrconf.c:3662
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]
__dev_notify_flags+0x194/0x300 net/core/dev.c:8891
dev_change_flags+0xe3/0x1a0 net/core/dev.c:8929
Memory state around the buggy address:
ffff888024897f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888024898000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888024898080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888024898100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888024898180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================