unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Faraz Shahbazker <fshahbazker@wavecomp.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	Dragan Mladjenovic <dmladjenovic@wavecomp.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Cc: Joseph Myers <joseph@codesourcery.com>,
	Carlos O'Donell <carlos@redhat.com>,
	"Maciej W . Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH v2 0/3] Mips support for PT_GNU_STACK
Date: Wed, 17 Jul 2019 22:59:12 +0000	[thread overview]
Message-ID: <afa259cf-4f4d-a492-996e-dbdc2fabbb37@wavecomp.com> (raw)
In-Reply-To: <a21dabcc-4f24-8d74-08c6-3ee57b3df2bb@linaro.org>

On 07/17/2019 12:43 PM, Adhemerval Zanella wrote:
> I think checking the kernel version is the wrong approach, it prevents a distribution
> to backport the kernel fix without also applying a out-of-tree patch to fix it on glibc
> as well.  IMHO the proper way would be to make kernel advertise it through hwcap, as
> other architectures do for similar kernel features and not tie it to any specific
> version.

The original proposal was to advertise through AT_FLAGS. I've heard this suggestion of using
hwcap from multiple sources, so I am curious - what other *purely* software kernel features
are advertised using hwcap?

>> The last patch increments the ABI Version number in order to disallow new
>> binaries to run with older glibc. The number is not set in stone.
>> I'm assuming it will probably land after GNU_HASH [3] support which consumes
>> ABI version 5 for MIPS. I will send a proposal for Binutils and GCC after this
>> part gets finalized.
> 
> If the idea is to fallback to executable stack for the case of underlying missing
> kernel support, which is the net gain in adding this requirement? My understanding
> it ABI bump should be used to fail early for the cases where the new binaries
> requires loader support that can not be provided (iFUNC or new relocations), not
> for hardening.

It is not really hardening, the way glibc handles PT_GNU_STACK is along the lines of
'may have non-executable stack' rather than 'must have non-executable stack'. However
the MIPS backend overrides *any* incoming PT_GNU_STACK permissions using the default (RWX)
permissions for MIPS, in effect enforcing 'will not have non-executable stack'. What is
being indicated here is a change in this default behaviour. The ABI version bump would
indicate whether PT_GNU_STACK permissions will be honoured (at least to the extent it is
by other architectures) or simply ignored (as it has historically been).

IMO, the current behaviour of PT_GNU_STACK for MIPS is an anomaly in itself. What should
have been, is a rejection of non-executable PT_GNU_STACK at some level, instead of silently
overriding it in glibc. So are you of the opinion that this change in glibc behaviour is not
worth being published at all, or that it should be advertised using a different mechanism
instead of an ABI version bump?

Regards,
Faraz

  parent reply	other threads:[~2019-07-17 22:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 18:23 [PATCH v2 0/3] Mips support for PT_GNU_STACK Dragan Mladjenovic
2019-07-16 11:15 ` [PATCH v2 1/3] [ELF] Allow the machine support to enforce executable stack Dragan Mladjenovic
2019-07-16 11:16   ` [PATCH v2 2/3] [MIPS] Define DL_EXEC_STACK_OVERRIDE Dragan Mladjenovic
2019-07-16 11:16   ` [PATCH v2 3/3] [RFC][MIPS] Define GNU_STACK ABI Dragan Mladjenovic
2019-07-17 19:43 ` [PATCH v2 0/3] Mips support for PT_GNU_STACK Adhemerval Zanella
2019-07-17 21:47   ` Dragan Mladjenovic
2019-07-18 13:33     ` Adhemerval Zanella
2019-07-18 20:00       ` Dragan Mladjenovic
2019-07-17 22:59   ` Faraz Shahbazker [this message]
2019-07-18 13:38     ` Adhemerval Zanella
2019-07-18 15:34       ` Faraz Shahbazker
2019-07-18 19:49       ` Dragan Mladjenovic
2019-07-18 20:54         ` Adhemerval Zanella
2019-07-18 14:50   ` Maciej W. Rozycki

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afa259cf-4f4d-a492-996e-dbdc2fabbb37@wavecomp.com \
    --to=fshahbazker@wavecomp.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=dmladjenovic@wavecomp.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).