linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Hans-Christian Egtvedt <egtvedt@samfundet.no>,
	Mike Frysinger <vapier@gentoo.org>,
	Mark Salter <msalter@redhat.com>,
	Mikael Starvik <starvik@axis.com>,
	Jesper Nilsson <jesper.nilsson@axis.com>,
	David Howells <dhowells@redhat.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Richard Kuo <rkuo@codeaurora.org>,
	Hirokazu Takata <takata@linux-m32r.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Michal Simek <monstr@monstr.eu>,
	Koichi Yasutake <yasutake.koichi@jp.panasonic.com>,
	Jonas Bonn <jonas@southpole.se>,
	Chen Liqin <liqin.chen@sunplusct.com>,
	Lennox Wu <lennox.wu@gmail.com>, Paul Mundt <lethal@linux-sh.org>,
	"David S. Miller" <davem@davemloft.net>,
	Chris Zankel <chris@zankel.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RFC] cross-arch: don't corrupt personality flags upon exec()
Date: Wed, 15 Aug 2012 15:45:20 -0700	[thread overview]
Message-ID: <20120815154520.f9cf4e24.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LNX.2.00.1208131518520.29827@pobox.suse.cz>

On Mon, 13 Aug 2012 15:19:40 +0200 (CEST)
Jiri Kosina <jkosina@suse.cz> wrote:

> On Fri, 3 Aug 2012, Jiri Kosina wrote:
> 
> > Historically, the top three bytes of personality have been used for things 
> > such as ADDR_NO_RANDOMIZE, which made sense only for specific 
> > architectures.
> > 
> > We now, however, have a flag there that is general no matter the 
> > architecture (UNAME26); generally we have to be careful to preserve the 
> > personality flags across exec().
> > 
> > This patch tries to fix all architectures that forcefully overwrite
> > personality flags during exec() (ppc32 and s390 have been fixed recently 
> > by commits f9783ec86 and 59e4c3a2f in a similar way already).
> > 
> > Signed-off-by: Jiri Kosina <jkosina@suse.cz>
> > ---
> > 
> > Untested, as I don't own the hardware.
> 
> Ping, Acks, Nacks, anyone?

Silence means "I'll fix it if you broke it" ;)

> Andrew, if noone has any objections, I guess this should perhaps go 
> through -mm.

Sure.  But..


> > --- a/arch/blackfin/include/asm/elf.h
> > +++ b/arch/blackfin/include/asm/elf.h
> > @@ -132,6 +132,7 @@ do {											\
> >  
> >  #define ELF_PLATFORM  (NULL)
> >  
> > -#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
> > +#define SET_PERSONALITY(ex) \
> > +	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))

This is repeated soooo many times.  Could we not just delete it and, in
include/linux/elf.h, do:

#ifndef SET_PERSONALITY
<that stuff>
#endif

?

If any SET_PERSONALITY-using code is including asm/elf.h directly then
it will reliably break and will get fixed.

Extra marks will be awarded if you can work out whether to use
PER_LINUX_32BIT ;)


  reply	other threads:[~2012-08-15 22:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03 10:01 [PATCH] [RFC] cross-arch: don't corrupt personality flags upon exec() Jiri Kosina
2012-08-13 13:19 ` Jiri Kosina
2012-08-15 22:45   ` Andrew Morton [this message]
2012-08-22 19:27     ` Arnd Bergmann
2012-08-28 16:53       ` Chris Metcalf
2012-08-28 18:49         ` Jiri Kosina
2012-08-28 19:04           ` Chris Metcalf

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=20120815154520.f9cf4e24.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=egtvedt@samfundet.no \
    --cc=geert@linux-m68k.org \
    --cc=hskinnemoen@gmail.com \
    --cc=jesper.nilsson@axis.com \
    --cc=jkosina@suse.cz \
    --cc=jonas@southpole.se \
    --cc=lennox.wu@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqin.chen@sunplusct.com \
    --cc=monstr@monstr.eu \
    --cc=msalter@redhat.com \
    --cc=rkuo@codeaurora.org \
    --cc=starvik@axis.com \
    --cc=takata@linux-m32r.org \
    --cc=vapier@gentoo.org \
    --cc=yasutake.koichi@jp.panasonic.com \
    --cc=ysato@users.sourceforge.jp \
    /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).