syzbot


BUG: sleeping function called from invalid context in lock_sock_nested (2)

Status: upstream: reported C repro on 2025/02/23 00:56
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+3fd940c701b7555d6f7b@syzkaller.appspotmail.com
First crash: 323d, last: 6d10h
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2025/04/25 linux-6.1.y (ToT) 535ec20c5027 C [report] BUG: sleeping function called from invalid context in lock_sock_nested
2025/03/10 upstream (ToT) 80e54e84911a C [report] BUG: sleeping function called from invalid context in lock_sock_nested
2025/04/25 upstream (ToT) 02ddfb981de8 C Didn't crash
Similar bugs (23)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 BUG: sleeping function called from invalid context in lock_sock_nested (2) 5 C done 3909 1583d 1676d 1/1 fixed on 2021/10/12 13:38
upstream BUG: sleeping function called from invalid context in lock_sock_nested (2) bluetooth 5 C done error 19391 1615d 2150d 20/29 fixed on 2021/11/10 13:22
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested 5 1 2385d 2385d 0/1 auto-closed as invalid on 2019/10/30 11:24
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested (2) 5 syz done 1 2170d 2230d 1/1 fixed on 2020/03/04 10:17
linux-4.19 BUG: sleeping function called from invalid context in lock_sock_nested 5 syz done 1 2200d 2230d 1/1 fixed on 2020/02/05 13:33
linux-6.1 BUG: sleeping function called from invalid context in lock_sock_nested 5 7 541d 562d 0/3 auto-obsoleted due to no activity on 2024/10/28 05:57
upstream BUG: sleeping function called from invalid context in lock_sock_nested bpf net 5 C 1232 2154d 2230d 15/29 fixed on 2020/02/18 14:31
linux-4.14 BUG: sleeping function called from invalid context in lock_sock_nested (3) 5 syz error 144 1170d 1676d 0/1 upstream: reported syz repro on 2021/06/10 20:33
upstream BUG: sleeping function called from invalid context in lock_sock_nested (3) net bluetooth 19 C inconclusive error 153 130d 608d 0/29 auto-obsoleted due to no activity on 2025/11/12 14:25
linux-5.15 BUG: sleeping function called from invalid context in lock_sock_nested missing-backport origin:lts-only 19 C done 25 3d18h 562d 0/3 upstream: reported C repro on 2024/06/29 07:50
upstream BUG: unable to handle kernel paging request in lock_sock_nested bluetooth 17 43 1545d 1985d 0/29 auto-closed as invalid on 2022/02/16 22:16
linux-4.19 KASAN: wild-memory-access Write in lock_sock_nested 23 2 1809d 1878d 0/1 auto-closed as invalid on 2021/05/28 14:35
linux-4.14 general protection fault in lock_sock_nested 2 4 1710d 1928d 0/1 auto-closed as invalid on 2021/09/04 19:35
linux-4.19 KASAN: use-after-free Read in lock_sock_nested 23 C 471 1048d 2361d 0/1 upstream: reported C repro on 2019/07/26 21:27
linux-4.14 KASAN: use-after-free Read in lock_sock_nested 19 C inconclusive 331 1088d 2455d 0/1 upstream: reported C repro on 2019/04/24 06:28
upstream KASAN: use-after-free Read in lock_sock_nested hams 19 C inconclusive done 1856 957d 2566d 0/29 auto-obsoleted due to no activity on 2023/08/23 09:06
upstream general protection fault in lock_sock_nested bluetooth 19 C done done 4082 10h44m 854d 0/29 upstream: reported C repro on 2023/09/11 07:52
linux-5.15 general protection fault in lock_sock_nested missing-backport origin:upstream 8 C error 154 4d08h 647d 0/3 upstream: reported C repro on 2024/04/04 13:25
linux-4.14 BUG: unable to handle kernel paging request in lock_sock_nested 8 4 1703d 1823d 0/1 auto-closed as invalid on 2021/09/11 11:51
linux-6.1 general protection fault in lock_sock_nested origin:upstream missing-backport 19 C inconclusive 212 3d05h 638d 0/3 upstream: reported C repro on 2024/04/14 08:46
upstream KASAN: slab-out-of-bounds Read in lock_sock_nested bluetooth 17 syz unreliable done 23 1539d 1979d 0/29 auto-obsoleted due to no activity on 2022/09/29 10:19
linux-4.19 KASAN: slab-out-of-bounds Read in lock_sock_nested 23 14 1222d 1886d 0/1 auto-obsoleted due to no activity on 2023/01/05 15:59
linux-6.6 general protection fault in lock_sock_nested origin:upstream 2 C 29 18d 207d 0/2 upstream: reported C repro on 2025/06/19 04:51
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2025/10/24 14:37 1h35m fix candidate upstream OK (0) job log
2025/03/27 03:34 18m bisect fix linux-6.1.y error job log

Sample crash report:
Bluetooth: hci4: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci2: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci4: Ignoring HCI_Sync_Conn_Complete event for existing connection
BUG: sleeping function called from invalid context at net/core/sock.c:3498
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4447, name: kworker/u5:4
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
6 locks held by kworker/u5:4/4447:
 #0: ffff0000c3c1a138 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x6b4/0x13a8 kernel/workqueue.c:2265
 #1: ffff8000209c7c20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x6f8/0x13a8 kernel/workqueue.c:2267
 #2: ffff0000d4dd4078 (&hdev->lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x98/0x90c net/bluetooth/hci_event.c:5029
 #3: ffff8000178102a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1811 [inline]
 #3: ffff8000178102a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x3f8/0x90c net/bluetooth/hci_event.c:5115
 #4: ffff0000c8b57e20 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #4: ffff0000c8b57e20 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1304 [inline]
 #4: ffff0000c8b57e20 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x25c/0x8fc net/bluetooth/sco.c:1389
 #5: ffff0000c3725130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1792 [inline]
 #5: ffff0000c3725130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1317 [inline]
 #5: ffff0000c3725130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x3cc/0x8fc net/bluetooth/sco.c:1389
Preemption disabled at:
[<ffff800010bfaf10>] spin_lock include/linux/spinlock.h:351 [inline]
[<ffff800010bfaf10>] sco_conn_ready net/bluetooth/sco.c:1304 [inline]
[<ffff800010bfaf10>] sco_connect_cfm+0x25c/0x8fc net/bluetooth/sco.c:1389
CPU: 0 PID: 4447 Comm: kworker/u5:4 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Workqueue: hci1 hci_rx_work
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 __might_resched+0x350/0x4cc kernel/sched/core.c:9966
 __might_sleep+0x94/0x110 kernel/sched/core.c:9895
 lock_sock_nested+0x80/0x130 net/core/sock.c:3498
 lock_sock include/net/sock.h:1792 [inline]
 sco_conn_ready net/bluetooth/sco.c:1317 [inline]
 sco_connect_cfm+0x3cc/0x8fc net/bluetooth/sco.c:1389
 hci_connect_cfm include/net/bluetooth/hci_core.h:1814 [inline]
 hci_sync_conn_complete_evt+0x460/0x90c net/bluetooth/hci_event.c:5115
 hci_event_func net/bluetooth/hci_event.c:7415 [inline]
 hci_event_packet+0x6f4/0xf08 net/bluetooth/hci_event.c:7467
 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083
 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Bluetooth: hci1: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci3: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci1: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci3: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci4: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci4: Ignoring HCI_Sync_Conn_Complete event for existing connection
Bluetooth: hci5: Ignoring HCI_Sync_Conn_Complete event for existing connection

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/05 23:58 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2026/01/03 07:53 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2026/01/03 06:57 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/12/29 05:49 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/11/12 01:05 linux-6.1.y f6e38ae624cf 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/02/23 05:28 linux-6.1.y 3a8358583626 d34966d1 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/02/23 04:08 linux-6.1.y 3a8358583626 d34966d1 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/02/23 03:06 linux-6.1.y 3a8358583626 d34966d1 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/02/23 01:59 linux-6.1.y 3a8358583626 d34966d1 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
2025/08/03 21:32 linux-6.1.y 3594f306da12 7368264b .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf KASAN: use-after-free Write in lock_sock_nested
2025/08/19 21:50 linux-6.1.y 0bc96de781b4 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan BUG: sleeping function called from invalid context in lock_sock_nested
2025/02/23 00:56 linux-6.1.y 3a8358583626 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: sleeping function called from invalid context in lock_sock_nested
* Struck through repros no longer work on HEAD.