LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Eric Paris <eparis@redhat.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH] flex_array: Change behaviour on zero size allocations
Date: Wed, 2 Feb 2011 08:55:20 +0100 [thread overview]
Message-ID: <20110202075520.GN3070@secunet.com> (raw)
In-Reply-To: <1296573623.3145.6.camel@localhost.localdomain>
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
prev parent reply other threads:[~2011-02-02 7:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 8:52 Steffen Klassert
2011-01-31 16:31 ` Dave Hansen
2011-02-01 10:24 ` Steffen Klassert
2011-02-01 11:03 ` Steffen Klassert
2011-02-01 14:55 ` Dave Hansen
2011-02-01 15:20 ` Eric Paris
2011-02-02 7:55 ` Steffen Klassert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110202075520.GN3070@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=akpm@linux-foundation.org \
--cc=dave@linux.vnet.ibm.com \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--subject='Re: [PATCH] flex_array: Change behaviour on zero size allocations' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).