All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: Matthew Fortune <Matthew.Fortune@imgtec.com>,
	Faraz Shahbazker <Faraz.Shahbazker@imgtec.com>
Cc: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	"Raghu Gandham" <Raghu.Gandham@imgtec.com>,
	Maciej Rozycki <Maciej.Rozycki@imgtec.com>
Subject: Re: [RFC PATCH v3 2/2] MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present
Date: Thu, 30 Jun 2016 11:34:21 +0100	[thread overview]
Message-ID: <fb77e2f2-801d-8dd5-6121-73909ebbd227@imgtec.com> (raw)
In-Reply-To: <6D39441BF12EF246A7ABCE6654B023537E465A74@HHMAIL01.hh.imgtec.org>

On 30/06/16 10:25, Matthew Fortune wrote:
> Paul Burton <Paul.Burton@imgtec.com> writes:
>> The stack and heap have both been executable by default on MIPS until
>> now. This patch changes the default to be non-executable, but only for
>> ELF binaries with a non-executable PT_GNU_STACK header present. This
>> does apply to both the heap & the stack, despite the name PT_GNU_STACK,
>> and this matches the behaviour of other architectures like ARM & x86.
>>
>> Current MIPS toolchains do not produce the PT_GNU_STACK header, which
>> means that we can rely upon this patch not changing the behaviour of
>> existing binaries. The new default will only take effect for newly
>> compiled binaries once toolchains are updated to support PT_GNU_STACK,
>> and since those binaries are newly compiled they can be compiled
>> expecting the change in default behaviour. Again this matches the way in
>> which the ARM & x86 architectures handled their implementations of
>> non-executable memory.
>
> There will be some extra work on top of this to inform user-mode that
> no-exec-stack support is actually safe. I'm a bit fuzzy on the exact
> details though as I have not been directly involved for a while.
>
> https://www.sourceware.org/ml/libc-alpha/2016-01/msg00719.html
>
> Adding Faraz who worked on the user-mode side and Maciej who has been
> reviewing.

Hi Matthew,

Interesting. That glibc patch seems to imply that the kernel already 
supports this, which isn't true. It makes use of a 
"AV_FLAGS_MIPS_GNU_STACK" constant & says that's taken from Linux, but 
it doesn't exist. Are you using an experimental patch for the kernel 
side (perhaps Leonid's?). I'm not sure why you'd use AT_FLAGS for this, 
which Linux currently unconditionally sets to 0 for all architectures. 
Would a HWCAP bit for RIXI perhaps be more suitable?

Thanks,
     Paul

  reply	other threads:[~2016-06-30 10:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 14:38 [RFC PATCH v3 0/2] MIPS non-executable stack support Paul Burton
2016-06-29 14:38 ` Paul Burton
2016-06-29 14:38 ` [RFC PATCH v3 1/2] MIPS: use per-mm page to execute branch delay slot instructions Paul Burton
2016-06-29 14:38   ` Paul Burton
2016-06-30  9:01   ` Matt Redfearn
2016-06-30  9:01     ` Matt Redfearn
2016-06-30 10:17     ` Paul Burton
2016-06-30 10:17       ` Paul Burton
2016-06-30 10:40       ` Matt Redfearn
2016-06-30 10:40         ` Matt Redfearn
2016-06-30 10:49         ` Paul Burton
2016-06-30 10:49           ` Paul Burton
2016-06-29 14:38 ` [RFC PATCH v3 2/2] MIPS: non-exec stack & heap when non-exec PT_GNU_STACK is present Paul Burton
2016-06-29 14:38   ` Paul Burton
2016-06-30  9:25   ` Matthew Fortune
2016-06-30 10:34     ` Paul Burton [this message]
2016-06-30 12:04       ` Matthew Fortune
2016-06-30 16:25         ` Paul Burton
2016-06-30 17:40           ` Faraz Shahbazker
2016-06-30 18:48             ` Maciej W. Rozycki
2016-07-01  0:49             ` David Daney
2016-07-01 17:11               ` Paul Burton

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=fb77e2f2-801d-8dd5-6121-73909ebbd227@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=Faraz.Shahbazker@imgtec.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=Maciej.Rozycki@imgtec.com \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=Raghu.Gandham@imgtec.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.