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

Published May 27, 2026
·
Updated

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

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

hdlcappend() calls usleeprange() to wait for circular buffer space, but it is called with txproducerlock (a spinlock) held via hdlctxframes() -> hdlcappendtxframe()/hdlcappendtxu8()/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 hdlcappend() and into hdlctxframes(), 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.

Affected Software

4 affected components
Linux Linux kernel (greybus: gb-beagleplay)
Linux Linux kernel>=6.7<6.12.86
Linux Linux kernel>=6.13<6.18.27
Linux Linux kernel>=6.19<7.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In greybus hdlc_tx_frames(), pre-calculate the worst-case encoded frame length and move the buffer-space wait (including usleep_range()) out of hdlc_append() and before acquiring tx_producer_lock; wait until enough space is available, then acquire the spinlock, re-verify space, and enqueue the entire frame atomically.

Event History

May 27, 2026
CVE Published
via MITRE·12:56 PM
Data Sourced
via MITRE·12:56 PM
Description
Data Sourced
via NVD·02:17 PM
RemedyDescriptionSeverityAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203