[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFEvwukbxCY4wffd_1jLo+vjfXfBC4sFDpJ1vY4wfT+=yFA--w@mail.gmail.com>
Date: Tue, 13 Oct 2020 14:31:21 +0530
From: harshal chaudhari <harshalchau04@...il.com>
To: Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Greg KH <gregkh@...uxfoundation.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] char: ppdev: check if ioctl argument is present and valid
On Sat, Oct 10, 2020 at 2:41 PM Sudip Mukherjee
<sudipm.mukherjee@...il.com> wrote:
>
> On Sat, Oct 10, 2020 at 1:08 AM Sudip Mukherjee
> <sudipm.mukherjee@...il.com> wrote:
> >
> > On Fri, Oct 9, 2020 at 5:57 AM Greg KH <gregkh@...uxfoundation.org> 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.
Thanks Greg for the comment. i am checking with value
-EFAULT now, i will get back to you with changes as consideration
of Arnd comments.
> > > And it doesn't match what your patch says, please be consistent.
I just want to perform the Argument check here only. back then i
was trying with access_ok() as well, but access_ok() return success
even if i passed a NULL pointer. so that's why i removed it from here.
> > > And do you have this device to be able to test your changes?
Yes I have a device and I tested these changes with the few ioctls.
> > 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.
Thanks a lot Sudip for your time.
> --
> Regards
> Sudip
Powered by blists - more mailing lists