{"id":"CVE-2026-139049","state":"PUBLISHED","title":"media: hws: Wait for IRQ handler before returning buffers","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: hws: Wait for IRQ handler before returning buffers\n\nhws_stop_streaming() disables capture and then collects the active and\nqueued buffers straight away. Clearing cap_active and setting\nstop_requested only stops a VDONE handler that has not checked them\nyet; one already running on another CPU has passed those checks and\ncannot be recalled.\n\nThat handler snapshots v->active into a local pointer and drops\nirq_lock before it touches the buffer, so stop_streaming can run in\nbetween. Without a next_prepared buffer both paths complete the same\nbuffer, and the second vb2_buffer_done() hits the WARN_ON for a buffer\nthat is no longer active. With a next_prepared buffer the snapshot is\nthe only remaining reference to the old active buffer, so\nstop_streaming returns without it and vb2 reports \"stop_streaming\noperation is leaving buffer %u in active state\" before completing it\nwith an error.\n\nEither way the driver breaks the vb2 rule that stop_streaming has to\ngive back every buffer it owns before it returns.\n\nWait for the handler once the hardware is disabled and before the\nbuffers are collected. The live mode change and the channel cleanup\npaths already do this around the same collect helper.","publishedAt":"2026-11-30T13:27:23.651Z","updatedAt":"2026-11-30T13:27:23.651Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ba07fd2f5742e8b0d965003b34c7a44eb4f67e53","status":"affected","lessThan":"9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b","versionType":"git"},{"version":"ba07fd2f5742e8b0d965003b34c7a44eb4f67e53","status":"affected","lessThan":"1ba17b5a54187e8bb251ff9636ed65c84719b013","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/media/pci/hws/hws_video.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/media/pci/hws/hws_video.c"]}],"references":["https://git.kernel.org/stable/c/9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b","https://git.kernel.org/stable/c/1ba17b5a54187e8bb251ff9636ed65c84719b013"],"weaknesses":[],"ingestedAt":"2026-11-30T13:42:04.437Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139049.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139049","state":"PUBLISHED","datePublished":"2026-11-30T13:27:23.651Z","dateUpdated":"2026-11-30T13:27:23.651Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.911Z"},"containers":{"cna":{"title":"media: hws: Wait for IRQ handler before returning buffers","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: hws: Wait for IRQ handler before returning buffers\n\nhws_stop_streaming() disables capture and then collects the active and\nqueued buffers straight away. Clearing cap_active and setting\nstop_requested only stops a VDONE handler that has not checked them\nyet; one already running on another CPU has passed those checks and\ncannot be recalled.\n\nThat handler snapshots v->active into a local pointer and drops\nirq_lock before it touches the buffer, so stop_streaming can run in\nbetween. Without a next_prepared buffer both paths complete the same\nbuffer, and the second vb2_buffer_done() hits the WARN_ON for a buffer\nthat is no longer active. With a next_prepared buffer the snapshot is\nthe only remaining reference to the old active buffer, so\nstop_streaming returns without it and vb2 reports \"stop_streaming\noperation is leaving buffer %u in active state\" before completing it\nwith an error.\n\nEither way the driver breaks the vb2 rule that stop_streaming has to\ngive back every buffer it owns before it returns.\n\nWait for the handler once the hardware is disabled and before the\nbuffers are collected. The live mode change and the channel cleanup\npaths already do this around the same collect helper."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ba07fd2f5742e8b0d965003b34c7a44eb4f67e53","status":"affected","lessThan":"9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b","versionType":"git"},{"version":"ba07fd2f5742e8b0d965003b34c7a44eb4f67e53","status":"affected","lessThan":"1ba17b5a54187e8bb251ff9636ed65c84719b013","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/media/pci/hws/hws_video.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/media/pci/hws/hws_video.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/9be75b4b0b37f6720cf7255c5c3ad021ca08ee3b"},{"url":"https://git.kernel.org/stable/c/1ba17b5a54187e8bb251ff9636ed65c84719b013"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:23.651Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}