Linux Media Controller development
 help / color / mirror / Atom feed
From: Benoit Sevens <bsevens@google.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, gregkh@linuxfoundation.org,
	 Benoit Sevens <bsevens@google.com>,
	stable@kernel.org
Subject: [PATCH v1 0/2] Skip parsing frames of type UVC_VS_UNDEFINED in
Date: Thu,  7 Nov 2024 14:22:01 +0000	[thread overview]
Message-ID: <20241107142204.1182969-1-bsevens@google.com> (raw)

This can lead to out of bounds writes since frames of this type were not
taken into account when calculating the size of the frames buffer in
uvc_parse_streaming.

I am proposing a series of 2 patches. First patch is very small and
fixes the issue. The idea is to have this patch merged quickly.

The second patch refactors the code into a new uvc_parse_frame function.

I do not have the hardware setup to test this out. The second patch
should definitely be tested.

Benoit Sevens (2):
  media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in
    uvc_parse_format
  media: uvcvideo: Refactor frame parsing code into a uvc_parse_frame
    function

 drivers/media/usb/uvc/uvc_driver.c | 228 ++++++++++++++++-------------
 1 file changed, 123 insertions(+), 105 deletions(-)

-- 
2.47.0.277.g8800431eea-goog


             reply	other threads:[~2024-11-07 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 14:22 Benoit Sevens [this message]
2024-11-07 14:22 ` [PATCH v1 1/2] media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format Benoit Sevens
2024-11-07 14:53   ` Greg KH
2024-11-07 15:04   ` Laurent Pinchart
2024-11-08  0:04     ` Laurent Pinchart
2024-11-07 14:22 ` [PATCH v1 2/2] media: uvcvideo: Refactor frame parsing code into a uvc_parse_frame function Benoit Sevens
2024-11-07 16:45   ` Laurent Pinchart
2024-11-07 18:58     ` Benoît Sevens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241107142204.1182969-1-bsevens@google.com \
    --to=bsevens@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox