All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: LMML <linux-media@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [GIT PULL FOR v3.7] Add missing vidioc-subdev-g-edid.xml.
Date: Mon, 1 Oct 2012 15:24:56 -0300	[thread overview]
Message-ID: <20121001152456.16923835@redhat.com> (raw)
In-Reply-To: <201209261033.51510.hverkuil@xs4all.nl>

Em Wed, 26 Sep 2012 10:33:51 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> On Tue 25 September 2012 13:56:34 Hans Verkuil wrote:
> > Hi Mauro,
> > 
> > As requested!
> 
> I've respun this tree, fixing one documentation bug (the max value for
> 'blocks' is 256, not 255) and adding an overflow check in v4l2-ioctl.c as
> reported by Dan Carpenter:
> 
> http://www.mail-archive.com/linux-media@vger.kernel.org/msg52640.html

It seems you forgot to send the patches for review at the ML (at least, I'm
not seeing it on my linux-media local inbox).

Also, please document it better. Only after reading Dan's email I was able
to understand *why* you wrote such patch, as your patch description is bogus:

> Subject: Return -EINVAL if blocks > 256.
>
>...
>
>@@ -2205,6 +2205,10 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
>                struct v4l2_subdev_edid *edid = parg;
> 
>                if (edid->blocks) {
>+                       if (edid->blocks > 256) {
>+                               ret = -EINVAL;
>+                               break;

Well, Kernel developers are generally able to read C, so you don't need to repeat
what's written at the code as the patch subject ;)

Dan's comment provides the reason why this patch is needed:

>  2207                          *array_size = edid->blocks * 128;
>                                              ^^^^^^^^^^^^^^^^^^
> This can overflow.

So, the patch subject should be saying, instead:

v4l2-ioctl: limit the max amount of edid blocks to avoid overflow

and putting Dan's comments in the body of the patch description.

Thanks!
Mauro

  reply	other threads:[~2012-10-01 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 11:56 [GIT PULL FOR v3.7] Add missing vidioc-subdev-g-edid.xml Hans Verkuil
2012-09-26  8:33 ` Hans Verkuil
2012-10-01 18:24   ` Mauro Carvalho Chehab [this message]
2012-10-02  6:50     ` Hans Verkuil

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=20121001152456.16923835@redhat.com \
    --to=mchehab@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hverkuil@xs4all.nl \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.