BUG: workqueue lockup in hci_uart_write_work

Status: moderation: reported on 2026/11/23 22:26
Subsystems: bluetooth
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+abcbd8aae3678e825ec2@syzkaller.appspotmail.com
First crash: 37m, last: 37m
✨ AI cause bisection: inconclusive (AI job)
✨ AI-generated root cause summary:

The workqueue lockup is caused by a combination of H5 link-control packet amplification with an unbounded unreliable TX queue in drivers/bluetooth/hci_h5.c and an unbounded non-sleeping TX loop in hci_uart_write_work() in drivers/bluetooth/hci_ldisc.c. In h5_handle_internal_rx(), receiving a Three-Wire (H5) conf_req packet unconditionally queues both conf_rsp and a new conf_req onto h5->unrel via h5_link_control() without checking h5->state or bounding h5->unrel. When two H5 endpoints are connected (e.g., over a PTY pair) or a peer repeatedly sends conf_req frames, h5_recv() (driven by flush_to_ldisc() on unbound system_dfl_wq) continuously refills h5->unrel while hci_uart_write_work() drains it in an unbounded while loop on the per-CPU system_wq (events) without yielding or requeuing. Because the worker remains in TASK_RUNNING (state:R) and only undergoes involuntary preemption, wq_worker_sleeping() is never invoked, idle pool workers are never woken, and pool->last_progress_ts stalls until wq_watchdog_timer_fn() reports a workqueue lockup.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit a041bdbe1f3a:

Root Cause Analysis

The reported BUG: workqueue lockup on CPU 0 (pool 2, events workqueue) is caused by the interaction of two defects in the Bluetooth Three-Wire UART (H5) protocol handler (drivers/bluetooth/hci_h5.c) and the HCI UART line discipline TX worker (drivers/bluetooth/hci_ldisc.c):

  1. H5 conf_req link-control amplification and unbounded h5->unrel queue (drivers/bluetooth/hci_h5.c)

    • In h5_handle_internal_rx() (drivers/bluetooth/hci_h5.c:363-365), receiving a conf_req link-control packet ({ 0x03, 0xfc }) unconditionally queues both a conf_rsp ({ 0x04, 0x7b }) and a new conf_req onto h5->unrel via h5_link_control():
      } else if (memcmp(data, conf_req, 2) == 0) {
          h5_link_control(hu, conf_rsp, 2);
          h5_link_control(hu, conf_req, 3);
      
    • Unlike bcsp_handle_le_pkt() (drivers/bluetooth/hci_bcsp.c:388-400), which only replies with a single conf_rsp, h5_handle_internal_rx() performs no check on h5->state (continuing to emit conf_req even after entering H5_ACTIVE), and h5_link_control() (drivers/bluetooth/hci_h5.c:128-142) appends sk_buffs to h5->unrel with no queue-length limit (nor does h5_enqueue() limit h5->unrel at drivers/bluetooth/hci_h5.c:649-652).
    • When two H5 endpoints are connected back-to-back (e.g., via a PTY pair using pty_write() -> tty_insert_flip_string_and_push_buffer()), or when a peer continuously feeds conf_req frames, each conf_req produces two outgoing packets (conf_rsp + conf_req), creating a self-sustaining, exponentially amplifying packet storm.
    • Because flush_to_ldisc() (drivers/tty/tty_buffer.c:469) runs on the unbound system_dfl_wq (events_unbound, pool 8 spanning cpus=0-1) and hci_uart_tty_receive() (drivers/bluetooth/hci_ldisc.c:647-674) unconditionally calls tty_unthrottle(tty), the peer's flip buffers continue to drain concurrently while h5->unrel grows and is continuously replenished.
  2. Unbounded non-sleeping TX loop on per-CPU system_wq (drivers/bluetooth/hci_ldisc.c)

Why the Workqueue Watchdog Triggers

  • As shown in the worker backtrace (kworker/0:6 in state:R, preempted inside preempt_schedule() from local_bh_enable() in __alloc_skb() called by h5_prepare_pkt() at drivers/bluetooth/hci_h5.c:727 from h5_dequeue() at drivers/bluetooth/hci_h5.c:796), the worker continuously executes hci_uart_write_work() in TASK_RUNNING and never blocks/sleeps.
  • Because involuntary preemption while TASK_RUNNING does not invoke wq_worker_sleeping() (kernel/workqueue.c:1521), pool->nr_running on CPU 0 (pool 2) remains non-zero. Consequently, none of the idle workers in pool 2 are woken to process queued events work items (psi_avgs_work, vmstat_shepherd, nsim_dev_hwstats_traffic_work), and pool->last_progress_ts never advances.
  • Once the stall exceeds the configured threshold (30s in the report), wq_watchdog_timer_fn() (kernel/workqueue.c:8153) detects the stalled pool and emits BUG: workqueue lockup.
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
a8952b21 bisect-cause IsRelease: ❌ ❓ BUG: workqueue lockup in hci_uart_write_work 2026/11/23 22:14 2026/11/23 22:14 2026/11/23 22:49 fab64d89
5e7b7072 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ BUG: workqueue lockup in hci_uart_write_work 2026/11/23 22:14 2026/11/23 22:14 2026/11/23 22:26 fab64d89

Sample crash report:
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 30s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x100
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=6 refcnt=7
    in-flight: 4833:hci_uart_write_work for 30s
    pending: psi_avgs_work, vmstat_shepherd, psi_avgs_work, nsim_dev_hwstats_traffic_work, psi_avgs_work
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=12 refcnt=13
    in-flight: 24:reg_todo for 68s
    pending: 8*nsim_dev_hwstats_traffic_work, 3*psi_avgs_work
workqueue events_unbound: flags=0x2
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=22 refcnt=23
    in-flight: 3231:cfg80211_wiphy_work for 61s cfg80211_wiphy_work ,2977:cfg80211_wiphy_work for 70s cfg80211_wiphy_work ,698:cfg80211_wiphy_work for 62s cfg80211_wiphy_work ,6908:nsim_dev_trap_report_work for 0s ,3355:cfg80211_wiphy_work for 59s cfg80211_wiphy_work ,222:cfg80211_wiphy_work for 71s cfg80211_wiphy_work ,3074:cfg80211_wiphy_work for 71s cfg80211_wiphy_work
    pending: nsim_dev_trap_report_work, macvlan_process_broadcast, toggle_allocation_gate, 6*nsim_dev_trap_report_work
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=8 refcnt=9
    in-flight: 5927:cfg80211_wiphy_work for 54s cfg80211_wiphy_work ,1200:cfg80211_wiphy_work for 73s cfg80211_wiphy_work ,3190:cfg80211_wiphy_work for 53s cfg80211_wiphy_work ,3292:nsim_dev_trap_report_work for 2s
    pending: flush_memcg_stats_dwork
workqueue events_power_efficient: flags=0x82
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_ratelimiter_gc_entries
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=8 refcnt=9
    in-flight: 13:neigh_periodic_work for 54s ,41:neigh_periodic_work for 15s ,1259:crda_timeout_work for 59s ,40:neigh_periodic_work for 38s
    pending: 4*neigh_periodic_work
workqueue events_dfl_long: flags=0x2
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=3 refcnt=4
    in-flight: 12:defense_work_handler for 1s
    pending: 2*defense_work_handler
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update
workqueue bat_events: flags=0x6000a
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=42 MAYDAY
    in-flight: 2870(RESCUER):batadv_tt_purge for 13s
    inactive: batadv_tt_purge, batadv_dat_purge, batadv_bla_periodic_work, 2*batadv_tt_purge, batadv_bla_periodic_work, batadv_dat_purge, batadv_iv_send_outstanding_bat_ogm_packet, batadv_dat_purge, batadv_bla_periodic_work, batadv_dat_purge, batadv_bla_periodic_work, 5*batadv_purge_orig, 2*batadv_iv_send_outstanding_bat_ogm_packet, 5*batadv_mcast_mla_update, 9*batadv_iv_send_outstanding_bat_ogm_packet, batadv_bla_periodic_work, batadv_dat_purge, batadv_tt_purge
workqueue wg-crypt-wg0: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_encrypt_worker
workqueue wg-kex-wg1: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_send_worker
workqueue wg-crypt-wg1: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_encrypt_worker
workqueue wg-kex-wg2: flags=0x124
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
workqueue wg-kex-wg2: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_send_worker
workqueue wg-crypt-wg0: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker, wg_packet_decrypt_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_tx_worker
workqueue wg-kex-wg1: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    in-flight: 5925:wg_packet_handshake_send_worker for 2s
workqueue wg-crypt-wg1: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_decrypt_worker, wg_packet_tx_worker, wg_packet_encrypt_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_encrypt_worker
workqueue wg-kex-wg2: flags=0x124
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
workqueue wg-crypt-wg2: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=2 refcnt=3
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker
workqueue wg-kex-wg0: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    in-flight: 5926:wg_packet_handshake_send_worker for 19s
workqueue wg-crypt-wg0: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_encrypt_worker
workqueue wg-kex-wg1: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_send_worker
workqueue wg-crypt-wg1: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=2 refcnt=3
    pending: wg_packet_decrypt_worker, wg_packet_encrypt_worker
workqueue wg-kex-wg2: flags=0x124
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
workqueue wg-kex-wg2: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_send_worker
workqueue wg-crypt-wg0: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=2 refcnt=3
    pending: wg_packet_tx_worker, wg_packet_encrypt_worker
workqueue wg-crypt-wg1: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker, wg_packet_decrypt_worker
workqueue wg-kex-wg2: flags=0x124
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
workqueue wg-crypt-wg2: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker, wg_packet_decrypt_worker
workqueue wg-kex-wg0: flags=0x6
  pwq 8: cpus=0-1 flags=0x6 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_send_worker
workqueue wg-crypt-wg0: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_tx_worker, wg_packet_decrypt_worker, wg_packet_encrypt_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_encrypt_worker
workqueue wg-crypt-wg1: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=3 refcnt=4
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker, wg_packet_decrypt_worker
workqueue wg-kex-wg2: flags=0x124
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_handshake_receive_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    in-flight: 4826:wg_packet_handshake_receive_worker for 7s
workqueue wg-crypt-wg2: flags=0x128
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=2 refcnt=3
    pending: wg_packet_encrypt_worker, wg_packet_tx_worker
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: wg_packet_tx_worker
pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=30s workers=9 idle: 1052 4818 4817 4481 9 5011 10 4845
pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=7s workers=7 idle: 4856 26 4909 876 6339
pool 8: cpus=0-1 flags=0x6 nice=0 hung=0s workers=19 manager: 6909
Showing backtraces of busy workers in stalled worker pools:
pool 2:
task:kworker/0:6     state:R  running task     stack:0     pid:4833  tgid:4833  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue: events hci_uart_write_work
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 preempt_schedule_common+0xd4/0x190 kernel/sched/core.c:7561
 preempt_schedule+0x60/0x78 kernel/sched/core.c:7585
 __local_bh_enable_ip+0x16c/0x234 kernel/softirq.c:480
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 __alloc_skb+0x1c8/0x610 net/core/skbuff.c:700
 alloc_skb include/linux/skbuff.h:1390 [inline]
 h5_prepare_pkt+0x180/0x534 drivers/bluetooth/hci_h5.c:727
 h5_dequeue+0x150/0x62c drivers/bluetooth/hci_h5.c:796
 hci_uart_dequeue drivers/bluetooth/hci_ldisc.c:107 [inline]
 hci_uart_write_work+0x1c4/0x578 drivers/bluetooth/hci_ldisc.c:161
 process_one_work kernel/workqueue.c:3495 [inline]
 process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/23 22:14 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a041bdbe1f3a e9bfbe3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: workqueue lockup in hci_uart_write_work
* Struck through repros no longer work on HEAD.