CVE-2026-139031: media: nuvoton: npcm-video: quiesce VCD IRQ before teardown
In the Linux kernel, the following vulnerability has been resolved:
media: nuvoton: npcm-video: quiesce VCD IRQ before teardown
The VCD IRQ is devm-requested, but npcmvideoremove() frees the video object before devres releases that IRQ. The threaded handler dereferences video->vcdregmap before checking VIDEOSTREAMING, so an interrupt in that interval can access freed memory.
Request the IRQ with IRQFNOAUTOEN. Enable it after starting capture and setting VIDEOSTREAMING, and disable it first in stopstreaming(). disableirq() waits for an in-flight threaded handler to finish, after which stopstreaming() can mask and reset the VCD without a handler re-enabling it.
Use vb2videounregisterdevice() during remove. It releases the vb2 queue and calls stopstreaming() for an active stream, ensuring that the IRQ is disabled before the video object is freed. Do not release the queue separately.
If streaming is never started, IRQFNOAUTOEN keeps the IRQ disabled until devres releases it.
This issue was found by an in-house static analysis tool.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Request the VCD IRQ with IRQF_NO_AUTOEN, enable it after starting capture and setting VIDEO_STREAMING, and disable it first in stop_streaming().
Linux kernel Nuvoton npcm-video driver VCD IRQ lifecycle = IRQF_NO_AUTOEN - Compensating control
Call vb2_video_unregister_device() during npcm_video_remove() to unregister the video device during teardown.