Making the stack executable
Hi,
It turns out that my mysterious lockups in the rt_sigreturn path were due to the fact that our stack pages are not executable.
They are being mapped with PAGE_COPY protection in exec.c, like every other architecture does, but unlike every other architecture, our PAGE_COPY did not include execute permissions.
Sorry folks but we do need trampolines.
What is more disturbing is that without _PAGE_EXEC set in PAGE_COPY, attempting to execute code on the stack just hangs the machine solid! (without printing out any error messages or register dumps)
The following program should demonstrate this problem:
.LEVEL 1.1 .text .align 4 .globl main main: .PROC .CALLINFO FRAME=64 stw %rp,-20(%sp) copy %sp,%r19 ldo 64(%sp),%sp ldil L%0xebe0c002,%r20 /* bv,n %r0(%r31) */ ldo R%0xebe0c002(%r20),%r20 stw %r20,0(%r19) fdc %r0(%r19) sync fic %r0(%r19) sync ble 0(%sr7,%r19) nop ldo -64(%sp),%sp bv,n %r0(%rp) .ENTRY .EXIT .PROCEND
Is this some kind of issue with our ITLB miss handlers?
I'll check in the change to <asm/pgtable.h> shortly, but I'd like someone to also look into the problem above (without the change).
Signature · 2 lines
[email protected], http://www.linuxcare.com/ Linuxcare. Support for the revolution.