lkml.org 
[lkml]   [2014]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] module: static checker complains about negative values
On Tue, May 20, 2014 at 11:16:04AM +0930, Rusty Russell wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
> > We cap "stat.size" at INT_MAX but we don't check for negative values so
> > my static checker complains. At this point, you already have control of
> > the kernel and if you start passing negative values here then you
> > deserve what happens next.
> >
> > On 64 bit systems the vmalloc() will definitely fail. On 32 bit systems
> > we truncate the upper 32 bits away so that could succeed. I haven't
> > followed it further than that.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> If vfs_getattr() returns a negative stat.size, we have worse problems.
>
> I'd rather see you sprinkle assertions like that into the code, so we
> can make sure that can't happen for any fs's getattr().

Yeah. I was lazy. Sorry. I can just hand edit my database to say that
i_size_read() returns a reasonable number...

regards,
dan carpenter



\
 
 \ /
  Last update: 2014-05-20 11:01    [W:1.041 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site