lkml.org 
[lkml]   [2011]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: flex_array related problems on selinux policy loading
From
Date
On Thu, 2011-01-27 at 13:46 +0100, Steffen Klassert wrote:
> On Wed, Jan 26, 2011 at 08:15:26AM -0800, Dave Hansen wrote:
> > On Wed, 2011-01-26 at 14:04 +0100, Steffen Klassert wrote:
> > > Another thing came to my mind. An atempt to do a zero size allocation
> > > always succeed on kmalloc. If we want to allocate our metadata even in
> > > this case, we should be aware that this allocation _can_ fail. So
> > > flex_array_alloc would not show the same behaviour as kmalloc on zero
> > > size allocations.
> >
> > I think that's just fine.
> >
> > You have to check for and handle those allocation failures anyway.
>
> If we just return a pointer to the user that notifies that this was a
> zerro size allocation, we would not need to allocate anything (like
> kmalloc does), so we can't get allocation failures.

Could you point me to some of this code? I'm having a hard time seeing
how this is going to get used, and I don't see any use of
ZERO_SIZE_PTR/ZERO_OR_NULL_PTR() outside of the sl*b code.

-- Dave



\
 
 \ /
  Last update: 2011-01-27 17:59    [W:0.177 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site