This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PING: [PATCH] x86: Add __sigsetjmp_cancel and __setjmp_cancel
- From: Zack Weinberg <zackw at panix dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Florian Weimer <fw at deneb dot enyo dot de>, Joseph Myers <joseph at codesourcery dot com>, "Carlos O'Donell" <carlos at redhat dot com>, "Tsimbalist, Igor V" <igor dot v dot tsimbalist at intel dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 29 Mar 2018 13:37:28 -0400
- Subject: Re: PING: [PATCH] x86: Add __sigsetjmp_cancel and __setjmp_cancel
- References: <CAMe9rOocRHdvpgX0eDUYQj5QGSXVV4Y6XyfPoA2e9TgAjxYKgA@mail.gmail.com>
On Thu, Mar 29, 2018 at 10:32 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Mar 22, 2018 at 1:59 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Mar 16, 2018 at 4:28 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Fri, Mar 16, 2018 at 1:24 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>>>> * H. J. Lu:
>>>>
>>>>> +/* Function used in the macros. */
>>>>> +struct __jmp_buf_tag;
>>>>> +extern int __sigsetjmp_cancel (struct __jmp_buf_tag *__env, int __savemask)
>>>>> + __THROWNL __attribute_returns_twice__;
>>>>
>>>> How is __THROWNL correct here? We do unwind through this function.
>>>> The __EXCEPTIONS guard is not effective because of LTO, and some
>>>> applications undefine __EXCEPTIONS to avoid the table-based
>>>> cancellation handlers.
>>>
>>> This is moved from <pthread.h>:
>>>
>>> /* Function used in the macros. */
>>> struct __jmp_buf_tag;
>>> extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
>>>
>>> Is <pthread.h> wrong?
>>
>> It turns out that since libpthread provides compatible versions of
>> longjmp and siglongjmp
>> which don't save and restore shadow stack, new versions of longjmp
>> and siglongjmp,
>> which save and restore shadow stack, should be added to libc.
>> Otherwise, porgrams
>> linked with libpthread will pick the wrong longjmp.
>>
>> Here is the updated patch. OK for master?
>>
>>
>
> PING:
>
> https://sourceware.org/ml/libc-alpha/2018-03/msg00521.html
>
> --
> H.J.