From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
syzbot+54fd8cca4b7226c94b8e@syzkaller.appspotmail.com,
Ezequiel Garcia <ezequiel@collabora.com>,
Vandana BN <bnvandana@gmail.com>,
Boris Brezillon <boris.brezillon@collabora.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: v4l2-core: only zero-out ioctl-read buffers
Date: Wed, 8 Jan 2020 12:10:04 +0200 [thread overview]
Message-ID: <20200108101004.GC4383@kekkonen.localdomain> (raw)
In-Reply-To: <20200108100013.284108-1-arnd@arndb.de>
On Wed, Jan 08, 2020 at 11:00:00AM +0100, Arnd Bergmann wrote:
> The memset() got moved out of the check for _IOC_NONE, so passing a
> made-up command number with a size but no direction would allow clearing
> data on user-provided pointers.
>
> Move video_get_user() back into the _IOC_NONE check where it belongs.
>
> Reported-by: syzbot+54fd8cca4b7226c94b8e@syzkaller.appspotmail.com
> Fixes: 6c625c01c7a6 ("media: v4l2-core: split out data copy from video_usercopy")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the fix, Arnd!
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index b0d670715c27..0f11fc6b5447 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -3208,12 +3208,12 @@ video_usercopy(struct file *file, unsigned int orig_cmd, unsigned long arg,
> parg = mbuf;
> }
>
> + err = video_get_user((void __user *)arg, parg, orig_cmd,
> + &always_copy);
> + if (err)
> + goto out;
> }
>
> - err = video_get_user((void __user *)arg, parg, orig_cmd, &always_copy);
> - if (err)
> - goto out;
> -
> err = check_array_args(cmd, parg, &array_size, &user_ptr, &kernel_ptr);
> if (err < 0)
> goto out;
--
Sakari Ailus
sakari.ailus@linux.intel.com
prev parent reply other threads:[~2020-01-08 10:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 10:00 Arnd Bergmann
2020-01-08 10:10 ` Sakari Ailus [this message]
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=20200108101004.GC4383@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=arnd@arndb.de \
--cc=bnvandana@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=ezequiel@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=syzbot+54fd8cca4b7226c94b8e@syzkaller.appspotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®