public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.4 0/1] media: v4l2-mem2mem: backport fix for CVE-2022-20369
@ 2022-08-08 12:41 Ovidiu Panait
  2022-08-08 12:41 ` [PATCH 5.4 1/1] media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls Ovidiu Panait
  0 siblings, 1 reply; 3+ messages in thread
From: Ovidiu Panait @ 2022-08-08 12:41 UTC (permalink / raw)
  To: stable, wenst, hverkuil-cisco, mchehab; +Cc: linux-media, Ovidiu Panait

Backport summary:
-----------------
The return logic in v4l2_m2m_qbuf() was adjusted manually so that it matches
the logic in the original commit (v4l2_m2m_adjust_mem_offset() being called
only if !ret and before the v4l2_m2m_try_schedule() call):

@@ -500,10 +510,16 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 		return -EPERM;
 	}
 	ret = vb2_qbuf(vq, vdev->v4l2_dev->mdev, buf);
-	if (!ret && !(buf->flags & V4L2_BUF_FLAG_IN_REQUEST))
+	if (ret)
+		return ret;
+
+	/* Adjust MMAP memory offsets for the CAPTURE queue */
+	v4l2_m2m_adjust_mem_offset(vq, buf);
+
+	if (!(buf->flags & V4L2_BUF_FLAG_IN_REQUEST))
 		v4l2_m2m_try_schedule(m2m_ctx);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_qbuf);

Build tested only.

Chen-Yu Tsai (1):
  media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across
    ioctls

 drivers/media/v4l2-core/v4l2-mem2mem.c | 60 ++++++++++++++++++++------
 1 file changed, 46 insertions(+), 14 deletions(-)

-- 
2.37.1


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

end of thread, other threads:[~2022-08-08 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-08 12:41 [PATCH 5.4 0/1] media: v4l2-mem2mem: backport fix for CVE-2022-20369 Ovidiu Panait
2022-08-08 12:41 ` [PATCH 5.4 1/1] media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls Ovidiu Panait
2022-08-08 13:27   ` Greg KH

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