lkml.org 
[lkml]   [2004]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Fix UDF-FS potentially dereferencing null
From
Date
On Sat, 2004-04-17 at 02:44, Linus Torvalds wrote:
> On Sat, 17 Apr 2004, Dave Jones wrote:
> >
> > And there's a *lot* of them. Those half dozen or so patches earlier were
> > results of just a quick random skim of the list the coverity folks came up with.
> >
> > It'll take a lot of effort to 'fix' them all, and given the non-severity
> > of a lot of them, I'm not convinced it's worth the effort.
>
> Just for the fun of it, I added a "safe" attribute to sparse (hey, it was
> trivial), and made it warn if you test a safe variable.
>
> You can do
>
> #define __safe __attribute__((safe))
>
> static struct denty *
> udf_lookup(struct inode * __safe dir,
> struct dentry * __safe dentry,
> struct nameidata * __safe nd);
>
> or

Hi,

is it maybe a good idea to map this to gcc's "nonnull" attribute in some
way? That way both sparse and the compiler get this explicit
knowledge.... (afaics gcc will then also just optimize out the null ptr
checks)
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.151 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site