[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 2 Feb 2011 08:55:20 +0100
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Eric Paris <eparis@...hat.com>
Cc: Dave Hansen <dave@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH] flex_array: Change behaviour on zero size allocations
On Tue, Feb 01, 2011 at 10:20:22AM -0500, Eric Paris wrote:
>
> I'm fine with any solution. It's obviously broken for SELinux to be
> passing -1 even if the library supported it. I guess I don't really
> have strong feelings on how to fix it.
>
> 1) make end exclusive
> 2) change 'end' to 'len'
> 3) just make selinux not prealloc() when the #elements == 0
>
> All seem perfectly reasonable to me, but I'd probably do them in that
> order.
>
I think I would prefer option 2. Passing a size or a length to
a memory allocator is quite common and we would not need to care
for bugs where 'end' is smaller than 'start'.
So I'd do it like that, if noone has strong feelings for another option.
Steffen
--
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