public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Carlos O'Donell" <carlos@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	"Senkevich, Andrew" <andrew.senkevich@intel.com>,
	 Andreas Schwab <schwab@suse.de>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 1/2] Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563]
Date: Thu, 25 Jan 2018 01:09:00 -0000	[thread overview]
Message-ID: <CAMe9rOqVokh0LabtO8oD1ZEc4fheD6gzNSiDA+gG9xAJbvt4Kw@mail.gmail.com> (raw)
In-Reply-To: <c41e4002-2c22-b254-bb5b-a73ee23b1a4f@redhat.com>

On Wed, Jan 24, 2018 at 4:32 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 01/24/2018 10:23 AM, Florian Weimer wrote:
>> On 01/24/2018 07:08 PM, H.J. Lu wrote:
>>> We opened a bug:
>>>
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=22743
>>>
>>> Any help to track down the root cause is appreciated.
>>
>> Doesn't the bug report clearly show the root cause?  The offset of
>> priv.data.cleanup changed, and old binaries have an insufficiently
>> large stack allocation for the new offset.
>>
>> (Congratulations for tracking it down, by the way.  I know that such
>> bugs are hard.)
>>
>> You need to add a symbol version for pthread_register_cancel.  It's
>> too late for that now, so I recommend reverting the faulty commit.
>
> I have finished analyzing this and debugging the root cause myself,
> and I agree with Florian, we need to revert:
>
> commit f81ddabffd76ac9dd600b02adbf3e1dac4bb10ec
> commit cba595c350e52194e10c0006732e1991e3d0803b
>
> At a minimum. I am testing with them reverted locally.
>
> To be honest I'm surprised that this passed review and was checked
> in, because the __pthread_unwind_buf_t has only at most 4-bytes of
> space left before it is an ABI change. In the future please ping
> me if you have any doubts and I'll review.
>
> The addition of __sigset_t saved_mask moves pthread_unwind_buf's
> priv.data.cleanup forward by 124-bytes. The on-stack allocation of
> the pthread_cleanup_push's __pthread_unwind_buf_t is not that big
> and so __pthread_register_cancel writes to other structures which
> are allocated on the stack.
>
> You cannot expand struct pthread_unwind_buf because the on-stack
> allocated __pthread_unwind_buf_t is not large enough in existing
> applications.
>
> You *might* have used feature_1 to change between two different
> layouts of struct pthread_unwind_buf, but that will have to wait
> for 2.28. As Florian suggests though it is cleaner to version
> __pthread_register_cancel for x86 and the older version expects
> the smaller non-CET-enabled structure.
>

I will try to fix it by next Monday.


-- 
H.J.

  parent reply	other threads:[~2018-01-25  1:09 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 17:41 H.J. Lu
2017-12-07 17:58 ` Joseph Myers
2017-12-07 18:37 ` Florian Weimer
2017-12-07 18:59   ` H.J. Lu
2017-12-07 19:09     ` Florian Weimer
2017-12-07 19:12       ` H.J. Lu
2017-12-07 19:14         ` Florian Weimer
2017-12-07 19:19           ` H.J. Lu
2017-12-07 19:25             ` Florian Weimer
2017-12-07 19:35               ` H.J. Lu
2017-12-08  2:25                 ` H.J. Lu
2017-12-14 13:06                   ` H.J. Lu
2017-12-15 17:43                     ` H.J. Lu
2017-12-18 10:25                   ` Florian Weimer
2017-12-18 11:42                     ` H.J. Lu
2017-12-18 11:49                       ` Florian Weimer
2017-12-18 12:25                         ` H.J. Lu
2017-12-18 12:52                           ` Florian Weimer
2017-12-18 13:19                             ` H.J. Lu
2017-12-18 14:13                               ` H.J. Lu
2017-12-18 14:45                                 ` Andreas Schwab
2017-12-18 14:48                                   ` H.J. Lu
2017-12-18 16:29                                     ` H.J. Lu
2018-01-09 10:47                                     ` Florian Weimer
2018-01-09 12:17                                       ` H.J. Lu
2018-01-09 16:20                                         ` Senkevich, Andrew
2018-01-21 16:16                                       ` Aurelien Jarno
2018-01-21 16:27                                         ` H.J. Lu
2018-01-21 16:50                                           ` Carlos O'Donell
2018-01-22 14:44                                           ` Senkevich, Andrew
2018-01-23 19:35                                             ` Carlos O'Donell
2018-01-23 21:13                                               ` Senkevich, Andrew
2018-01-24 18:08                                                 ` H.J. Lu
2018-01-24 18:23                                                   ` Florian Weimer
2018-01-25  0:32                                                     ` Carlos O'Donell
2018-01-25  0:56                                                       ` Joseph Myers
2018-01-25  1:09                                                       ` H.J. Lu [this message]
2018-01-25  1:44                                                         ` Carlos O'Donell
2018-01-25  1:48                                                         ` Dmitry V. Levin
2018-01-25  4:53                                                           ` [PATCH] Revert Intel CET changes to __jmp_buf_tag (Bug 22743) Carlos O'Donell
2018-01-25  5:33                                                             ` H.J. Lu
2018-01-25  9:47                                                               ` Florian Weimer
2018-01-25 12:38                                                                 ` H.J. Lu
2018-01-25 12:50                                                                   ` Florian Weimer
2018-01-25 13:00                                                                     ` H.J. Lu
2018-01-25 14:56                                                                       ` Zack Weinberg
2018-01-25 15:33                                                                         ` H.J. Lu
2018-01-25 16:22                                                                           ` Zack Weinberg
2018-01-25 16:28                                                                             ` H.J. Lu
2018-01-25 16:36                                                                               ` Carlos O'Donell
2018-01-25 16:40                                                                                 ` H.J. Lu
2018-01-25 16:46                                                                                   ` Carlos O'Donell
2018-01-25 17:01                                                                                     ` H.J. Lu
2018-01-26  7:46                                                                                       ` Carlos O'Donell
2018-01-28 18:40                                                                                         ` H.J. Lu
2018-01-25 16:47                                                                             ` Florian Weimer
2018-01-25 16:55                                                                               ` H.J. Lu
2018-01-25 18:26                                                                         ` Joseph Myers
2018-01-25 19:21                                                                     ` H.J. Lu
2018-01-25 16:37                                                               ` Carlos O'Donell
2018-01-25 16:38                                                                 ` Florian Weimer
2017-12-18 17:37                                 ` [PATCH 1/2] Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] Joseph Myers
2017-12-18 21:19                                   ` H.J. Lu

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=CAMe9rOqVokh0LabtO8oD1ZEc4fheD6gzNSiDA+gG9xAJbvt4Kw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=andrew.senkevich@intel.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /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).