Re: [PATCH] misc: xilinx-sdfec: remove check for ioctl cmd and argument.

From: Arnd Bergmann
Date: Sun Nov 01 2020 - 14:51:16 EST


On Sun, Nov 1, 2020 at 6:09 PM Harshal Chaudhari
<harshalchau04@xxxxxxxxx> 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@xxxxxxxxx>

Thanks for following up on this,

Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>