public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: "Carlos O'Donell" <carlos@redhat.com>,
	Florian Weimer <fw@deneb.enyo.de>,
	 "Tsimbalist, Igor V" <igor.v.tsimbalist@intel.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] x86: Use pad in pthread_unwind_buf to preserve shadow stack register
Date: Tue, 17 Apr 2018 23:20:00 -0000	[thread overview]
Message-ID: <CAMe9rOoSnQxjbhe=okLNjX0noZC8_xfxQs5gS6d845hSyKzGAw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1804171959590.1402@digraph.polyomino.org.uk>

On Tue, Apr 17, 2018 at 1:02 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Fri, 6 Apr 2018, H.J. Lu wrote:
>
>> https://github.com/hjl-tools/glibc/commit/9bf6aefa8fb45f8df140d42ce9cf890bb24076e1
>>
>> It should be binary backward compatible.  I will investigate if there is a way
>
> Increasing the size of a public type is always dangerous, because you can
> end up with one part of a program expecting the new, larger size but
> another part only allocating the old, smaller size.

That is true.  The allocated ucontext size must be no less than the size
expected by ucontext consumer.

> It might in some cases be compatible to the extent that existing linked
> programs and shared libraries work with new glibc, if new glibc will never

This is done by checking CET properties.  Both linker and dynamic linker
clear CET property bits if any module doesn't have CET bits set.  Glibc
should access new extended fields only if CET bits are set, which means
the new ucontext is used in all .o files.  That is why I want to extend
ucontext before we have found a solution so that if an object file has
CET bits set, it must use the new ucontext.

> try to write into the unallocated part of such objects allocated by an
> existing linked program or shared library.  However, any such change would
> need a careful analysis of how the type gets written to, and to what
> extent external libraries have interfaces that depend on the size of the
> type, and would need a NEWS entry explaining the change and discussing the
> compatibility issues with it.
>

Agreed,


-- 
H.J.

      reply	other threads:[~2018-04-17 23:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 17:41 H.J. Lu
2018-04-06  4:46 ` Carlos O'Donell
2018-04-06 12:59   ` H.J. Lu
2018-04-06 20:26     ` H.J. Lu
2018-04-12 21:36       ` Carlos O'Donell
2018-04-12 21:36     ` Carlos O'Donell
2018-04-12 23:50       ` H.J. Lu
2018-04-21  3:28         ` [PATCHv2] " Carlos O'Donell
2018-04-21 18:37           ` [PATCH/v3] " H.J. Lu
2018-05-02  4:43             ` Carlos O'Donell
2018-05-02 12:45               ` H.J. Lu
2018-04-17 20:03     ` [PATCH] " Joseph Myers
2018-04-17 23:20       ` H.J. Lu [this message]

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='CAMe9rOoSnQxjbhe=okLNjX0noZC8_xfxQs5gS6d845hSyKzGAw@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=carlos@redhat.com \
    --cc=fw@deneb.enyo.de \
    --cc=igor.v.tsimbalist@intel.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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).