Messages in this thread | | | Date | Fri, 05 Dec 2014 09:28:50 -0800 | From | David Daney <> | Subject | Re: [PATCH v3 3/3] MIPS: set stack/data protection as non-executable |
| |
On 12/02/2014 05:58 PM, Leonid Yegoshin wrote: > This is a last step of 3 patches which shift FPU emulation out of > stack into protected area. So, it disables a default executable stack. > > Additionally, it sets a default data area non-executable protection. > > Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
NAK!
Some programs require an executable stack, this patch will break them.
You can only select a non-executable stack in response to PT_GNU_STACK program headers in the ELF file of the executable program.
David Daney
> --- > arch/mips/include/asm/page.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h > index 3be81803595d..d49ba81cb4ed 100644 > --- a/arch/mips/include/asm/page.h > +++ b/arch/mips/include/asm/page.h > @@ -230,7 +230,7 @@ extern int __virt_addr_valid(const volatile void *kaddr); > #define virt_addr_valid(kaddr) \ > __virt_addr_valid((const volatile void *) (kaddr)) > > -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ > +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ > VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) > > #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) > > > >
| |