From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/1] v4l: Check pad arguments for [gs]_frame_interval
Date: Fri, 23 May 2014 11:24:28 +0200 [thread overview]
Message-ID: <26941099.67PAgQvcPC@avalon> (raw)
In-Reply-To: <1396254188-7277-1-git-send-email-sakari.ailus@linux.intel.com>
Hi Sakari,
Thank you for the patch.
On Monday 31 March 2014 11:23:08 Sakari Ailus wrote:
> VIDIOC_SUBDEV_[GS]_FRAME_INTERVAL IOCTLs argument structs contain the pad
> field but the validity check was missing. There should be no implications
> security-wise from this since no driver currently uses the pad field in the
> struct.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/v4l2-core/v4l2-subdev.c | 16 ++++++++++++++--
> 1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c
> b/drivers/media/v4l2-core/v4l2-subdev.c index aea84ac..0ed4c5b 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -305,11 +305,23 @@ static long subdev_do_ioctl(struct file *file,
> unsigned int cmd, void *arg) fse);
> }
>
> - case VIDIOC_SUBDEV_G_FRAME_INTERVAL:
> + case VIDIOC_SUBDEV_G_FRAME_INTERVAL: {
> + struct v4l2_subdev_frame_interval *fi = arg;
> +
> + if (fi->pad >= sd->entity.num_pads)
> + return -EINVAL;
> +
> return v4l2_subdev_call(sd, video, g_frame_interval, arg);
> + }
> +
> + case VIDIOC_SUBDEV_S_FRAME_INTERVAL: {
> + struct v4l2_subdev_frame_interval *fi = arg;
> +
> + if (fi->pad >= sd->entity.num_pads)
> + return -EINVAL;
>
> - case VIDIOC_SUBDEV_S_FRAME_INTERVAL:
> return v4l2_subdev_call(sd, video, s_frame_interval, arg);
> + }
>
> case VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL: {
> struct v4l2_subdev_frame_interval_enum *fie = arg;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-05-23 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 8:23 [PATCH 1/1] v4l: Check pad arguments for [gs]_frame_interval Sakari Ailus
2014-05-23 9:24 ` Laurent Pinchart [this message]
2014-05-23 9:40 ` Sakari Ailus
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=26941099.67PAgQvcPC@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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.