Re: [PATCH] char: ppdev: check if ioctl argument is present and valid
From: Sudip Mukherjee
Date: Sat Oct 10 2020 - 18:57:40 EST
On Sat, Oct 10, 2020 at 1:08 AM Sudip Mukherjee
<sudipm.mukherjee@xxxxxxxxx> wrote:
>
> On Fri, Oct 9, 2020 at 5:57 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Thu, Oct 08, 2020 at 11:57:13PM +0530, Harshal Chaudhari wrote:
> > > Checking the argument passed to the ioctl is valid
> > > or not. if not then return -EINVAL.
> >
> > Along the the comments that Arnd made, this is not the correct value to
> > be returning from an ioctl when you don't pass in the correct command.
> >
> > And it doesn't match what your patch says, please be consistent.
> >
> > And do you have this device to be able to test your changes?
>
> I will test this tomorrow. But from an initial look, its going to
> break ppdev. There are few ioctls which don't need any arguments.
No, sorry. I missed the check for _IOC_NONE.
Tested on a desktop which has a parallel port with a very basic test
code of open->claim->write->release->close and it still works.
--
Regards
Sudip