CVE-2026-139049
published high CVSS 3.1 · 7.0media: hws: Wait for IRQ handler before returning buffers
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxba07fd2f5742e8b0d965003b34c7a44eb4f67e53 to < 9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b · ba07fd2f5742e8b0d965003b34c7a44eb4f67e53 to < 1ba17b5a54187e8bb251ff9636ed65c84719b013 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux7.2 (affected) · 0 to < 7.2 (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: media: hws: Wait for IRQ handler before returning buffers hws_stop_streaming() disables capture and then collects the active and queued buffers straight away. Clearing cap_active and setting stop_requested only stops a VDONE handler that has not checked them yet; one already running on another CPU has passed those checks and cannot be recalled. That handler snapshots v->active into a local pointer and drops irq_lock before it touches the buffer, so stop_streaming can run in between. Without a next_prepared buffer both paths complete the same buffer, and the second vb2_buffer_done() hits the WARN_ON for a buffer that is no longer active. With a next_prepared buffer the snapshot is the only remaining reference to the old active buffer, so stop_streaming returns without it and vb2 reports "stop_streaming operation is leaving buffer %u in active state" before completing it with an error. Either way the driver breaks the vb2 rule that stop_streaming has to give back every buffer it owns before it returns. Wait for the handler once the hardware is disabled and before the buffers are collected. The live mode change and the channel cleanup paths already do this around the same collect helper.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.0 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The free side is a local process acting on the hws /dev/videoN node: VIDIOC_STREAMOFF or close() runs vb2_fop_release -> vb2_core_queue_release -> __vb2_queue_cancel -> hws_stop_streaming(), and then __vb2_queue_free(). The other side is the card's VDONE interrupt for a captured HDMI frame. No remote protocol carries input to hws_video_handle_vdone(). AC:H - hws_video_handle_vdone() must pass its stop_requested/cap_active check and be inside the roughly 200 ns window between spin_unlock(irq_lock) and vb2_buffer_done(). hws_stop_streaming() first spends about 2 µs on register readbacks in hws_enable_video_capture(). Winning therefore needs the hard-IRQ handler to stall (SMI/NMI/vCPU preemption) for the whole teardown, which the attacker cannot cause. PR:L - hws_open() is only v4l2_fh_open(), and the streaming ioctls (with vdev->lock=state_lock) have no capable() check. The capture node is udev GROUP=video 0660 plus the uaccess tag, so any video-group member or logged-in seat user can start streaming and close the fd. UI:N - The attacker's own process queues buffers, issues VIDIOC_STREAMON so the card raises VDONE per frame, and times STREAMOFF/close() against the frame cadence. No other user or administrator has to do anything. S:U - The freed object is the kernel's vb2_buffer/hwsvideo_buffer, allocated by vb2 for this queue, and the stale use happens in the same kernel's hard-IRQ handler. No VM, sandbox or IOMMU boundary is crossed. C:H - After kfree(vb) in __vb2_queue_free(), the handler's local done pointer feeds vb2_buffer_done(), which reads vb->state, vb->vb2_queue and vb->planes from the freed slab object. If that object is reclaimed, attacker-controlled pointers are dereferenced, which can be leveraged for kernel memory disclosure. I:H - The handler writes planes[0].bytesused, sequence and timestamp into the freed buffer. vb2_buffer_done() then does list_add_tail(&vb->done_entry, &q->done_list), atomic_dec(owned_by_drv_count) and call_void_memop(finish) through vb->vb2_queue. On a reclaimed object that is a pointer write plus an indirect call. A:H - A stale vb2_queue pointer in hard-IRQ context oopses as a fatal exception in interrupt. Even the narrower outcomes break the queue: a double vb2_buffer_done() races its unlocked state check into a double list_add, which is a BUG under BUG_ON_DATA_CORRUPTION, or leaves an active buffer behind and triggers the vb2 WARNs.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | ba07fd2f5742e8b0d965003b34c7a44eb4f67e53 to < 9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b (affected · git)ba07fd2f5742e8b0d965003b34c7a44eb4f67e53 to < 1ba17b5a54187e8bb251ff9636ed65c84719b013 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 7.2 (affected)0 to < 7.2 (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
1Linux · cna
media: hws: Wait for IRQ handler before returning buffers
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 63bd5c2cf9ddb7f7560766deb733bee7a433982a184cf7b0c155eff8b2f17ddf
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record