[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJJx0O7GhHghy+sC4fJL2O=RsO+Zgm78r9SNt-aTbhqcw@mail.gmail.com>
Date: Fri, 5 Dec 2014 10:51:15 -0800
From: Kees Cook <keescook@...omium.org>
To: David Daney <ddaney.cavm@...il.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@...tec.com>,
Linux MIPS Mailing List <linux-mips@...ux-mips.org>,
Zubair.Kakakhel@...tec.com, geert+renesas@...der.be,
david.daney@...ium.com, Peter Zijlstra <peterz@...radead.org>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
davidlohr@...com, "Maciej W. Rozycki" <macro@...ux-mips.org>,
chenhc@...ote.com, cl@...ux.com, Ingo Molnar <mingo@...nel.org>,
Richard Weinberger <richard@....at>,
Rafał Miłecki <zajec5@...il.com>,
James Hogan <james.hogan@...tec.com>,
Tejun Heo <tj@...nel.org>, alex@...x-smith.me.uk,
Paolo Bonzini <pbonzini@...hat.com>,
John Crispin <blogic@...nwrt.org>,
Paul Burton <paul.burton@...tec.com>, qais.yousef@...tec.com,
LKML <linux-kernel@...r.kernel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Markos Chandras <markos.chandras@...tec.com>,
dengcheng.zhu@...tec.com, manuel.lauss@...il.com,
lars.persson@...s.com
Subject: Re: [PATCH v3 3/3] MIPS: set stack/data protection as non-executable
On Fri, Dec 5, 2014 at 9:28 AM, David Daney <ddaney.cavm@...il.com> wrote:
> 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@...tec.com>
>
>
> NAK!
>
> Some programs require an executable stack, this patch will break them.
Have you tested this?
> You can only select a non-executable stack in response to PT_GNU_STACK
> program headers in the ELF file of the executable program.
This is already handled by fs/binfmt_elf.c. It does the parsing of the
PT_GNU_STACK needs, and sets up the stack flags appropriately. All the
change to VM_DATA_DEFAULT_FLAGS does is make sure that EXSTACK_DEFAULT
now means no VM_EXEC by default. If PT_GNU_STACK requires it, it gets
added back in.
-Kees
>
> 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)
>>
>>
>>
>>
>
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists