{"id":"CVE-2026-46041","summary":"greybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ngreybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames()\n\nhdlc_append() calls usleep_range() to wait for circular buffer space,\nbut it is called with tx_producer_lock (a spinlock) held via\nhdlc_tx_frames() -\u003e hdlc_append_tx_frame()/hdlc_append_tx_u8()/etc.\nSleeping while holding a spinlock is illegal and can trigger\n\"BUG: scheduling while atomic\".\n\nFix this by moving the buffer-space wait out of hdlc_append() and into\nhdlc_tx_frames(), before the spinlock is acquired.  The new flow:\n\n 1. Pre-calculate the worst-case encoded frame length.\n 2. Wait (with sleep) outside the lock until enough space is available,\n    kicking the TX consumer work to drain the buffer.\n 3. Acquire the spinlock, re-verify space, and write the entire frame\n    atomically.\n\nThis ensures that sleeping only happens without any lock held, and\nthat frames are either fully enqueued or not written at all.\n\nThis bug is found by CodeQL static analysis tool (interprocedural\nsleep-in-atomic query) and my code review.","modified":"2026-06-18T03:57:29.705971268Z","published":"2026-05-27T12:56:54.418Z","related":["openSUSE-SU-2026:10954-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46041.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/51667fe2d9294d66e0228b9f51d1f01b6680a641"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6b526dca0966f2370835765019a54319b78fca8d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9f2b87bcdfed55145acbf932dc12f2c057145cad"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b2801647c203a38e013802e9e9616b5bfac64968"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46041.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46041"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ec558bbfea671ac020a6dc6be8bf8f0ee556cce0"},{"fixed":"9f2b87bcdfed55145acbf932dc12f2c057145cad"},{"fixed":"b2801647c203a38e013802e9e9616b5bfac64968"},{"fixed":"51667fe2d9294d66e0228b9f51d1f01b6680a641"},{"fixed":"6b526dca0966f2370835765019a54319b78fca8d"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-46041.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.86"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.27"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.0.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-46041.json"}}],"schema_version":"1.7.5"}