CVE-2026-46041

greybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames()

State
Published
Severity
Not scored
Published
May 27, 2026
Updated
Jun 14, 2026
Reserved
May 13, 2026

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

greybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames()

hdlc_append() calls usleep_range() to wait for circular buffer space, but it is called with tx_producer_lock (a spinlock) held via hdlc_tx_frames() -> hdlc_append_tx_frame()/hdlc_append_tx_u8()/etc. Sleeping while holding a spinlock is illegal and can trigger "BUG: scheduling while atomic".

Fix this by moving the buffer-space wait out of hdlc_append() and into hdlc_tx_frames(), before the spinlock is acquired. The new flow:

1. Pre-calculate the worst-case encoded frame length. 2. Wait (with sleep) outside the lock until enough space is available, kicking the TX consumer work to drain the buffer. 3. Acquire the spinlock, re-verify space, and write the entire frame atomically.

This ensures that sleeping only happens without any lock held, and that frames are either fully enqueued or not written at all.

This bug is found by CodeQL static analysis tool (interprocedural sleep-in-atomic query) and my code review.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • ec558bbfea671ac020a6dc6be8bf8f0ee556cce0 to before 9f2b87bcdfed55145acbf932dc12f2c057145cadAffected
  • ec558bbfea671ac020a6dc6be8bf8f0ee556cce0 to before b2801647c203a38e013802e9e9616b5bfac64968Affected
  • ec558bbfea671ac020a6dc6be8bf8f0ee556cce0 to before 51667fe2d9294d66e0228b9f51d1f01b6680a641Affected
  • ec558bbfea671ac020a6dc6be8bf8f0ee556cce0 to before 6b526dca0966f2370835765019a54319b78fca8dAffected
LinuxLinux
  • 6.7Affected
  • before 6.7Not affected
  • 6.12.86 through 6.12.*Not affected
  • 6.18.27 through 6.18.*Not affected
  • 7.0.4 through 7.0.*Not affected
  • 7.1 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.