[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0706011249530.3598@schroedinger.engr.sgi.com>
Date: Fri, 1 Jun 2007 12:51:33 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Paul Jackson <pj@....com>
cc: srinivasa@...ibm.com, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
vatsa@...ibm.com, dino@...ibm.com, simon.derr@...l.net,
clameter@...ulhu.engr.sgi.com, rientjes@...gle.com
Subject: Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777
warning
On Fri, 1 Jun 2007, Paul Jackson wrote:
> > The allocated array has 0 bytes. Any dereference is an error.
>
> Well, then, that doesn't work either.
>
> We -agree- we can't have this failing. You suggested (if I understood
> correctly, which I doubt) that we set the pointer to NULL, and noted
> that derefencing a NULL pointer would fail. I agree such derefences
> would fail, and tried to point out that this would be bad. We can't
> have pointer dereferences failing in the kernel ... duh.
>
> Your reply seems like a non sequiter to me, pointing out that having
> a pointer to an array of 0 bytes fails as well. Ok - that's bad too.
Think about it some more...
> So we cannot have a NULL pointer, used unchecked, and we cannot have
> a non-NULL pointer to a zero byte array, used unchecked.
We must have a NULL pointer exactly because it cannot be dereferenced. It
is a safety precaution that the following code will not deference the
pointer to the array of zero size. Because attempting to access an object
in an array with zero object in them is an error.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists