Subject: Re: siginfo & no-exec permission - please test
To: Matthias Drochner <>
From: Chuck Silvers <>
List: port-powerpc
Date: 02/21/2004 07:16:25

I tried this patch on a macppc with a modified version of openbsd's
noexec test (I put a copy of this in

ktrace says it has the right effect:

   407 noexec   PSIG  SIGSEGV caught handler=0x180075c mask=(): code=SEGV_ACCERR, addr=0xffffe108, trap=1024)

I'll leave the ibm4xx stuff to someone else, but it looks fine to me.


On Thu, Feb 19, 2004 at 07:19:42PM +0100, Matthias Drochner wrote:
> Hi -
> I don't have a ppc box to test with atm, but I've done
> related fixes to other architectures, and from code
> inspection it appears to me that a little fix should be
> applied to the powerpc port as well:
> Desired behaviour is that a SIGSEGV is delivered to a
> process, with a siginfo si_code of SEGV_ACCERR if code
> execution is attempted from virtual memory mapped without
> execution permission (especially the stack).
> The appended patched should implement this.
> Unfortunately I don't have a test program ready to verify
> this -- the regression test in regress/sys/uvm/stack_noexec
> probably doesn't work because gcc's ppc target doesn't
> use stack trampolines afaics.
> Perhaps you've got another idea;-)
> While we are here, 2 observations:
> -powerpc/ibm4xx/trap.c appears to leave ksi.ksi_code
>  uninitialized at a number of places
> -it also calls trapsignal() directly, without the
>  emulation hook
> best regards
> Matthias