Linux Media Controller development
 help / color / mirror / Atom feed
* [RFC PATCH] media: vidtv: fix uaf in vidtv_bridge_on_new_pkts_avail
@ 2026-08-27  4:22 Jeffin Philip
  2026-08-27  4:26 ` Jeffin Philip
  0 siblings, 1 reply; 6+ messages in thread
From: Jeffin Philip @ 2026-08-27  4:22 UTC (permalink / raw)
  To: dwlsalmeida
  Cc: mchehab, linux-media, linux-kernel, Jeffin Philip,
	syzbot+c7fc4794e59786f5b4dc, stable

Attempting to unbind a dvbdevice that is in the process of feeding
data causes a UAF as we free the underlying device without
stopping the feed first. Fix this by stopping the stream first using
vidtv_stop_streaming(). However, our codepath in the reproducer
(mentioned in the below reply) does not decrement our users
(dmxdev->dvr_dvbdev->users) to 1 after it has been incremented to 2
by our read() in the reproducer, that is only possible on .release.
This can cause a task hang as dvb_dmxdev_release() uses wait_event()
in the wait_queue unless we use a close(fd)(in the reproducer).
Is this a problem? Please advise.

Reported-by: syzbot+c7fc4794e59786f5b4dc@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c7fc4794e59786f5b4dc
Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
---
 drivers/media/test-drivers/vidtv/vidtv_bridge.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c
index fd69b4ee16f4..98d918c7f0ff 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c
@@ -550,6 +550,8 @@ static void vidtv_bridge_remove(struct platform_device *pdev)
 
 	mutex_destroy(&dvb->feed_lock);
 
+	vidtv_stop_streaming(dvb);
+
 	for (i = 0; i < NUM_FE; ++i) {
 		dvb_unregister_frontend(dvb->fe[i]);
 		dvb_module_release(dvb->i2c_client_tuner[i]);
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-27  5:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27  4:22 [RFC PATCH] media: vidtv: fix uaf in vidtv_bridge_on_new_pkts_avail Jeffin Philip
2026-08-27  4:26 ` Jeffin Philip
2026-08-27  4:51   ` Greg KH
2026-08-27  5:15     ` Jeffin Philip
2026-08-27  5:20       ` Greg KH
2026-08-27  5:30         ` Jeffin Philip

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox