From: Sean Young <sean@mess.org>
To: Hans Verkuil <hverkuil+cisco@kernel.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] media: cec: extron-da-hd-4k-plus: add sanity check
Date: Mon, 29 Jun 2026 14:57:39 +0100 [thread overview]
Message-ID: <akJ506JWu_B3-p2K@extorris.mess.org> (raw)
In-Reply-To: <186b19c9-e9f0-42e1-8c40-c594022acd5a@kernel.org>
On Thu, Jun 18, 2026 at 01:16:22PM +0200, Hans Verkuil wrote:
> On 18/06/2026 13:03, Hans Verkuil wrote:
> > Add check to prevent overflowing msg.msg[] in case the incoming data
> > is malformed.
> >
> > Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
>
> Fixes: 056f2821b631 ("media: cec: extron-da-hd-4k-plus: add the Extron DA HD 4K Plus CEC driver")
> Cc: stable@vger.kernel.org
Looks good.
Reviewed-by: Sean Young <sean@mess.org>
>
> Regards,
>
> Hans
>
> > ---
> > diff --git a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
> > index 3381d86096a1..3c6ce6f3d93e 100644
> > --- a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
> > +++ b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
> > @@ -657,7 +657,8 @@ static void extron_process_received(struct extron_port *port, const char *data)
> > if (!port || port->disconnected)
> > return;
> >
> > - if (len < 5 || (len - 2) % 3 || data[len - 2] != '*')
> > + if (len < 5 || ((len - 2) / 3 > sizeof(msg.msg)) ||
> > + (len - 2) % 3 || data[len - 2] != '*')
> > goto malformed;
> >
> > while (*data != '*') {
> >
>
next prev parent reply other threads:[~2026-06-29 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 11:03 [PATCH] media: cec: extron-da-hd-4k-plus: add sanity check Hans Verkuil
2026-06-18 11:16 ` Hans Verkuil
2026-06-29 13:57 ` Sean Young [this message]
2026-06-29 14:03 ` Laurent Pinchart
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=akJ506JWu_B3-p2K@extorris.mess.org \
--to=sean@mess.org \
--cc=hverkuil+cisco@kernel.org \
--cc=linux-media@vger.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