linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: fix personality flag propagation across an exec
Date: Fri, 8 Apr 2011 20:10:35 +0100	[thread overview]
Message-ID: <20110408191035.GA5573@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.00.1104080856000.28032@xanadu.home>

On Fri, Apr 08, 2011 at 09:00:07AM -0400, Nicolas Pitre wrote:
> On Fri, 8 Apr 2011, Russell King - ARM Linux wrote:
> 
> > On Thu, Apr 07, 2011 at 10:52:53PM -0400, Nicolas Pitre wrote:
> > >  	/*
> > > +	 * Inherit most personality flags from parent, except for those
> > > +	 * we're about to choose.  Beware: PER_LINUX_32BIT carries flag bits
> > > +	 * outside of PER_MASK.
> > > +	 */
> > > +	personality &= ~(PER_MASK | PER_LINUX | PER_LINUX_32BIT);
> > 
> > PER_LINUX and PER_LINUX_32BIT aren't bitflags - the LSB is a numeric
> > personality ID.  So this looks wrong.
> 
> >From include/linux/personality.h:
> 
> enum {
>         PER_LINUX =             0x0000,
>         PER_LINUX_32BIT =       0x0000 | ADDR_LIMIT_32BIT,
>         PER_LINUX_FDPIC =       0x0000 | FDPIC_FUNCPTRS,
>         PER_SVR4 =              0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
>         [...]
> 
> So this is a combination of a personality ID and flag bits.  And the 
> only difference between PER_LINUX and PER_LINUX_32BIT is one of those 
> flag bits.

Yes but its wrong to clear the bitmask using ~PER_LINUX etc.

What you want to be doing is:

	personality &= ~(PER_MASK | ADDR_LIMIT_32BIT);

so you're clearing the LSB being the personality type, and the 32-bit
address limit.

  reply	other threads:[~2011-04-08 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08  2:52 [PATCH 2/2] ARM: fix personality flag propagation across an exec Nicolas Pitre
2011-04-08  7:29 ` Russell King - ARM Linux
2011-04-08 13:00   ` Nicolas Pitre
2011-04-08 19:10     ` Russell King - ARM Linux [this message]
2011-04-08 19:50       ` Nicolas Pitre
2011-04-08 20:15         ` Russell King - ARM Linux
2011-04-08 20:44           ` Nicolas Pitre

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=20110408191035.GA5573@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).