lkml.org 
[lkml]   [2020]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] char: ppdev: check if ioctl argument is present and valid
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

\
 
 \ /
  Last update: 2020-10-13 12:59    [W:0.138 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site