All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: sy0816.kang@samsung.com
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: v4l2-compat-ioctl32.c: copy reserved2 field in get_v4l2_buffer32
Date: Fri, 17 Apr 2020 09:24:02 +0200	[thread overview]
Message-ID: <20200417092402.3322e2da@coco.lan> (raw)
In-Reply-To: <20200417024543.66785-1-sy0816.kang@samsung.com>

Em Fri, 17 Apr 2020 11:45:23 +0900
sy0816.kang@samsung.com escreveu:

> From: Sunyoung Kang <sy0816.kang@samsung.com>
> 
> get_v4l2_buffer32() didn't copy reserved2 field from userspace to driver.
> So the reserved2 value is not received through compat-ioctl32 in driver.
> This patch copy reserved2 field of v4l2_buffer in get_v4l2_buffer32().

Why should it copy reserved values? Those should not be used anywhere.

> 
> Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com>
> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> index a99e82ec9ab6..e9b2b9c0ec9a 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -665,6 +665,7 @@ static int get_v4l2_buffer32(struct v4l2_buffer __user *p64,
>  	if (V4L2_TYPE_IS_OUTPUT(type))
>  		if (assign_in_user(&p64->bytesused, &p32->bytesused) ||
>  		    assign_in_user(&p64->field, &p32->field) ||
> +		    assign_in_user(&p64->reserved2, &p32->reserved2) ||
>  		    assign_in_user(&p64->timestamp.tv_sec,
>  				   &p32->timestamp.tv_sec) ||
>  		    assign_in_user(&p64->timestamp.tv_usec,



Thanks,
Mauro

  reply	other threads:[~2020-04-17  7:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200417025205epcas2p46d33e64f2de49041d2ca68ecc98fc83e@epcas2p4.samsung.com>
2020-04-17  2:45 ` [PATCH] media: v4l2-compat-ioctl32.c: copy reserved2 field in get_v4l2_buffer32 sy0816.kang
2020-04-17  7:24   ` Mauro Carvalho Chehab [this message]
2020-04-18  3:13     ` Sunyoung Kang
2020-04-17  8:35   ` Greg Kroah-Hartman
2020-04-18  3:14     ` Sunyoung Kang
2020-04-18  7:37       ` 'Greg Kroah-Hartman'
2020-04-20  0:40         ` Sunyoung Kang
2020-04-20 11:23           ` Arnd Bergmann
2020-04-21  3:33             ` Sunyoung Kang
2020-04-21  7:46               ` Mauro Carvalho Chehab

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=20200417092402.3322e2da@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sy0816.kang@samsung.com \
    --cc=tglx@linutronix.de \
    /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.