syzbot


BUG: sleeping function called from invalid context in __hci_cmd_sync_sk

Status: fixed on 2023/12/21 03:45
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+c715e1bd8dfbcb1ab176@syzkaller.appspotmail.com
Fix commit: acab8ff29a2a Bluetooth: ISO: Fix invalid context error
First crash: 516d, last: 395d
Cause bisection: introduced by (bisect log) :
commit 2e846cd83f6285f4fee49389954b1b1215f5e504
Author: Iulia Tanasescu <iulia.tanasescu@nxp.com>
Date: Tue May 30 14:21:59 2023 +0000

  Bluetooth: ISO: Add support for connecting multiple BISes

Crash: BUG: sleeping function called from invalid context in __hci_cmd_sync_sk (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bluetooth?] BUG: sleeping function called from invalid context in __hci_cmd_sync_sk 0 (2) 2023/09/20 22:54
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/08/30 23:00 34m retest repro linux-next report log
2023/06/17 13:09 27m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 1f6ce8392d6f OK log
Cause bisection attempts (3)
Created Duration User Patch Repo Result
2023/09/20 18:56 3h57m bisect linux-next OK (1) job log log
2023/07/28 12:14 0m bisect linux-next error job log
marked invalid by nogikh@google.com
2023/06/16 11:00 0m bisect linux-next error job log
marked invalid by nogikh@google.com

Sample crash report:
BUG: sleeping function called from invalid context at net/bluetooth/hci_sync.c:167
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 4449, name: kworker/u5:1
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by kworker/u5:1/4449:
 #0: ffff8880291ecd38 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x787/0x15c0 kernel/workqueue.c:2605
 #1: ffffc9000e58fd80 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7e9/0x15c0 kernel/workqueue.c:2606
 #2: ffff888074ef8078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xde/0xab0 net/bluetooth/hci_event.c:7036
 #3: ffffffff8cbab2a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:303 [inline]
 #3: ffffffff8cbab2a0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:749 [inline]
 #3: ffffffff8cbab2a0 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0x100/0xab0 net/bluetooth/hci_event.c:7037
CPU: 0 PID: 4449 Comm: kworker/u5:1 Not tainted 6.6.0-rc2-syzkaller-00386-g3aba70aed91f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Workqueue: hci0 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106
 __might_resched+0x3c3/0x5e0 kernel/sched/core.c:10187
 __hci_cmd_sync_sk+0x374/0xe70 net/bluetooth/hci_sync.c:167
 __hci_cmd_sync_status_sk+0x48/0x160 net/bluetooth/hci_sync.c:248
 __hci_cmd_sync_status net/bluetooth/hci_sync.c:274 [inline]
 hci_le_terminate_big_sync+0xb2/0xe0 net/bluetooth/hci_sync.c:1673
 hci_le_create_big_complete_evt+0x765/0xab0 net/bluetooth/hci_event.c:7073
 hci_le_meta_evt+0x2bc/0x510 net/bluetooth/hci_event.c:7305
 hci_event_func net/bluetooth/hci_event.c:7635 [inline]
 hci_event_packet+0x642/0xfd0 net/bluetooth/hci_event.c:7690
 hci_rx_work+0x2c4/0x13e0 net/bluetooth/hci_core.c:4094
 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
 process_scheduled_works kernel/workqueue.c:2703 [inline]
 worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
 kthread+0x33c/0x440 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
 </TASK>
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 0 PID: 4449 at kernel/rcu/tree_plugin.h:320 rcu_note_context_switch+0xbfc/0x1ac0 kernel/rcu/tree_plugin.h:320
Modules linked in:
CPU: 0 PID: 4449 Comm: kworker/u5:1 Tainted: G        W          6.6.0-rc2-syzkaller-00386-g3aba70aed91f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Workqueue: hci0 hci_rx_work
RIP: 0010:rcu_note_context_switch+0xbfc/0x1ac0 kernel/rcu/tree_plugin.h:320
Code: da 56 6b 00 4c 8b 54 24 30 48 8b 44 24 28 8b 4c 24 10 e9 24 04 00 00 48 c7 c7 a0 71 8e 8a c6 05 56 3f 46 0d 01 e8 24 cb db ff <0f> 0b e9 0c f5 ff ff 81 e5 ff ff ff 7f 0f 84 ab f6 ff ff 65 48 8b
RSP: 0018:ffffc9000e58f490 EFLAGS: 00010082
RAX: 0000000000000000 RBX: ffff8880b983d600 RCX: 0000000000000000
RDX: ffff888029651dc0 RSI: ffffffff814df0c6 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffff888029651dc0
R13: ffff888029651dc0 R14: ffff888029651dc0 R15: ffff8880b983c700
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000050 CR3: 000000007354d000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __schedule+0x293/0x5a10 kernel/sched/core.c:6595
 schedule+0xe7/0x1b0 kernel/sched/core.c:6771
 schedule_timeout+0x157/0x2c0 kernel/time/timer.c:2167
 __hci_cmd_sync_sk+0x58b/0xe70 net/bluetooth/hci_sync.c:167
 __hci_cmd_sync_status_sk+0x48/0x160 net/bluetooth/hci_sync.c:248
 __hci_cmd_sync_status net/bluetooth/hci_sync.c:274 [inline]
 hci_le_terminate_big_sync+0xb2/0xe0 net/bluetooth/hci_sync.c:1673
 hci_le_create_big_complete_evt+0x765/0xab0 net/bluetooth/hci_event.c:7073
 hci_le_meta_evt+0x2bc/0x510 net/bluetooth/hci_event.c:7305
 hci_event_func net/bluetooth/hci_event.c:7635 [inline]
 hci_event_packet+0x642/0xfd0 net/bluetooth/hci_event.c:7690
 hci_rx_work+0x2c4/0x13e0 net/bluetooth/hci_core.c:4094
 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
 process_scheduled_works kernel/workqueue.c:2703 [inline]
 worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
 kthread+0x33c/0x440 kernel/kthread.c:388
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
 </TASK>

Crashes (34):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/24 15:55 upstream 3aba70aed91f 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/24 10:00 upstream 3aba70aed91f 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/06/14 02:11 linux-next 1f6ce8392d6f d2ee9228 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/10/12 18:51 upstream 401644852d0b fc170927 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/10/04 15:36 upstream cbf3a2cb156a b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 05:19 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 05:19 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:37 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:35 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:22 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:18 upstream 8a511e7efc5a 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:14 upstream 8a511e7efc5a 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:13 upstream 8a511e7efc5a 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/24 09:41 upstream 3aba70aed91f 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/11 17:16 upstream 0bb80ecc33a8 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/03 09:00 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:24 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:22 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:27 upstream 6465e260f487 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:27 upstream 6465e260f487 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:21 upstream 6465e260f487 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:18 upstream 6465e260f487 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:13 linux-next 940fcc189c51 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:12 linux-next 940fcc189c51 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 04:05 linux-next 940fcc189c51 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 21:09 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bf6547d8715b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/09/25 18:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bf6547d8715b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/08/12 23:20 linux-next 21ef7b1e17d0 39990d51 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/08/12 23:07 linux-next 21ef7b1e17d0 39990d51 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/07/12 17:16 linux-next 40b055fe7f27 979d5fe2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/06/13 23:52 linux-next 1f6ce8392d6f d2ee9228 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/06/13 17:19 linux-next 1f6ce8392d6f d2ee9228 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/06/13 14:59 linux-next 1f6ce8392d6f 749afb64 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
2023/06/13 11:06 linux-next 1f6ce8392d6f 749afb64 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in __hci_cmd_sync_sk
* Struck through repros no longer work on HEAD.