mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jake Moilanen <moilanen@austin.ibm.com>
To: Paul Mackerras <paulus@samba.org>
Cc: akpm@osdl.org, linuxppc64-dev@ozlabs.org,
	linux-kernel@vger.kernel.org, anton@samba.org,
	olof@austin.ibm.com, benh@kernel.crashing.org,
	amodra@bigpond.net.au
Subject: Re: [PATCH 1/2] No-exec support for ppc64
Date: Mon, 14 Mar 2005 15:51:25 -0600	[thread overview]
Message-ID: <20050314155125.68dcff70.moilanen@austin.ibm.com> (raw)
In-Reply-To: <16949.25552.640180.677985@cargo.ozlabs.ibm.com>

On Mon, 14 Mar 2005 21:13:36 +1100
Paul Mackerras <paulus@samba.org> wrote:

> Jake Moilanen writes:
> 
> > diff -puN fs/binfmt_elf.c~nx-user-ppc64 fs/binfmt_elf.c
> > --- linux-2.6-bk/fs/binfmt_elf.c~nx-user-ppc64	2005-03-08 16:08:54 -06:00
> > +++ linux-2.6-bk-moilanen/fs/binfmt_elf.c	2005-03-08 16:08:54 -06:00
> > @@ -99,6 +99,8 @@ static int set_brk(unsigned long start, 
> >  		up_write(&current->mm->mmap_sem);
> >  		if (BAD_ADDR(addr))
> >  			return addr;
> > +
> > +  		sys_mprotect(start, end-start, PROT_READ|PROT_WRITE|PROT_EXEC);
> 
> I don't think I can push that upstream.  What happens if you leave
> that out?

The bss and the plt are in the same segment, and plt obviously needs to
be executable.

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .interp           PROGBITS        10000154 000154 00000d 00   A  0   0  1
	...
	...
  [26] .plt              NOBITS          10013c5c 003c34 000210 00 WAX  0   0  4
  [27] .bss              NOBITS          10013e6c 003c34 000128 00  WA  0   0  4


 Segment Sections...
   00
   01     .interp
   02     .interp .note.ABI-tag .note.SuSE .hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .text .fini .rodata
   03     .data .eh_frame .got2 .dynamic .ctors .dtors .jcr .got .sdata .sbss .plt .bss
   04     .dynamic
   05     .note.ABI-tag
   06     .note.SuSE
   07

Anton mentioned that Alan was considering putting plt into a new segment. 
 
> More generally, we are making a user-visible change, even for programs
> that aren't marked as having non-executable stack or heap, because we
> are now enforcing that the program can't execute from mappings that
> don't have PROT_EXEC.  Perhaps we should enforce the requirement for
> execute permission only on those programs that indicate somehow that
> they can handle it?

Unless a program is compiled w/ pt_gnu_stacks we will set the
READ_IMPLIES_EXEC personality and those applications should still
work as normal.

Jake

  reply	other threads:[~2005-03-14 22:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-08 22:59 [PATCH 0/2] " Jake Moilanen
2005-03-08 23:08 ` [PATCH 1/2] " Jake Moilanen
2005-03-10  3:22   ` Olof Johansson
2005-03-10 22:25     ` Jake Moilanen
2005-03-14 10:13       ` Paul Mackerras
2005-03-14 21:51         ` Jake Moilanen [this message]
2005-03-14 22:18           ` Paul Mackerras
2005-03-15 21:51             ` Jake Moilanen
2005-03-15 22:48               ` Alan Modra
2005-03-15 23:17                 ` Jake Moilanen
2005-03-16  6:10               ` Paul Mackerras
2005-03-16 21:45                 ` Jake Moilanen
2005-03-08 23:13 ` [PATCH 2/2] " Jake Moilanen
2005-03-09  3:02   ` Benjamin Herrenschmidt
2005-03-10  3:25   ` Olof Johansson
2005-03-10  7:15     ` Benjamin Herrenschmidt
2005-03-10 22:27       ` Jake Moilanen
2005-03-10 22:44         ` Benjamin Herrenschmidt
2005-03-11 14:01           ` Jake Moilanen

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=20050314155125.68dcff70.moilanen@austin.ibm.com \
    --to=moilanen@austin.ibm.com \
    --cc=akpm@osdl.org \
    --cc=amodra@bigpond.net.au \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=olof@austin.ibm.com \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®