On Sun, Nov 1, 2020 at 6:09 PM Harshal Chaudhari
<[email protected]> 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 <[email protected]>

Thanks for following up on this,

Reviewed-by: Arnd Bergmann <[email protected]>

Reply via email to