[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3fJqijYW-8eT7R+eTUwY_EL4LsG9bDzN2LxNHZ1vyc4A@mail.gmail.com>
Date: Sun, 1 Nov 2020 20:49:23 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Harshal Chaudhari <harshalchau04@...il.com>
Cc: gregkh <gregkh@...uxfoundation.org>,
Dragan Cvetic <dragan.cvetic@...inx.com>,
Derek Kiernan <derek.kiernan@...inx.com>,
Arnd Bergmann <arnd@...db.de>,
Michal Simek <michal.simek@...inx.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] misc: xilinx-sdfec: remove check for ioctl cmd and argument.
On Sun, Nov 1, 2020 at 6:09 PM Harshal Chaudhari
<harshalchau04@...il.com> wrote:
>
> if (_IOC_TYPE(cmd) != PP_IOCTL)
> return -ENOTTY;
>
> Invalid ioctl command check normally performs by “default” case.
>
> if (_IOC_DIR(cmd) != _IOC_NONE) {
> argp = (void __user *)arg;
> if (!argp)
> return -EINVAL; }
>
> And for checking ioctl arguments, copy_from_user()/copy_to_user()
> checks are enough.
>
> Signed-off-by: Harshal Chaudhari <harshalchau04@...il.com>
Thanks for following up on this,
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists