From: Greg KH <gregkh@linuxfoundation.org>
To: harshal chaudhari <harshalchau04@gmail.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] char: ppdev: check if ioctl argument is present and valid
Date: Tue, 13 Oct 2020 12:58:57 +0200 [thread overview]
Message-ID: <20201013105857.GA1940039@kroah.com> (raw)
In-Reply-To: <CAFEvwukbxCY4wffd_1jLo+vjfXfBC4sFDpJ1vY4wfT+=yFA--w@mail.gmail.com>
On Tue, Oct 13, 2020 at 02:31:21PM +0530, harshal chaudhari wrote:
> On Sat, Oct 10, 2020 at 2:41 PM Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > On Sat, Oct 10, 2020 at 1:08 AM Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > On Fri, Oct 9, 2020 at 5:57 AM Greg KH <gregkh@linuxfoundation.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.
-EFAULT is only used if there really is a memory fault, which I strongly
doubt is the case here.
> > > > 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.
access_ok() should never be used in drivers anymore.
thanks,
greg k-h
next prev parent reply other threads:[~2020-10-13 10:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 18:27 [PATCH] char: ppdev: check if ioctl argument is present and valid Harshal Chaudhari
2020-10-08 19:35 ` Arnd Bergmann
2020-10-09 4:57 ` Greg KH
2020-10-10 0:08 ` Sudip Mukherjee
2020-10-10 9:10 ` Sudip Mukherjee
2020-10-13 9:01 ` harshal chaudhari
2020-10-13 10:58 ` Greg KH [this message]
2020-10-13 11:12 ` David Laight
[not found] ` <CAFEvwu=76mPtXSEgpwSoRC0rC0tkU5BiEx1X5O2VwVSPJ7m4Rw@mail.gmail.com>
2020-10-24 19:21 ` Arnd Bergmann
2020-10-24 20:16 ` harshal chaudhari
2020-10-24 21:22 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201013105857.GA1940039@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=harshalchau04@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox