[PATCH] x86: Add __sigsetjmp_cancel and __setjmp_cancel
H.J. Lu
hjl.tools@gmail.com
Thu Mar 15 12:22:00 GMT 2018
On Wed, Mar 14, 2018 at 9:20 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 03/08/2018 10:23 PM, H.J. Lu wrote:
>> On Thu, Mar 8, 2018 at 4:47 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>>> On 03/08/2018 04:48 AM, H.J. Lu wrote:
>>>> True. This is the patch I have tested:
>>>>
>>>> https://github.com/hjl-tools/gcc/commit/e98087865405f051e93d5f35588789ef9686db4a
>>>
>>> I assume NOTRACK prefix is what Intel calls 'NO_TRACK_EN' in the CET
>>> documentation since binutils uses the 0x3E prefix for it and that matches
>>> the Intel CET docs. Please correct me if I'm wrong.
>>
>> That is correct.
>>
>>> In which case I agree, using NOTRACK is going to prevent a useful use
>>> of CET against writes to the cancellation jump buffer.
>>
>> True.
>>
>>> This patch looks good to me, but is not a *correctness* issue, it is
>>> simply that we want to extend coverage to the private cancellation
>>> setjmp/longjmp buffers.
>>>
>>> Is there any way we can do this with source markup instead of via
>>> a fragile list in the compiler?
>>>
>>> Presumably users may want to markup their own code like this also
>>> if they have custom implementations of functions that behave like
>>> setjmp/longjmp?
>>>
>>
>> Yes, we can use __attribute__((__returns_twice__)). I updated
>> hjl/setjmp/cancel branch to do that. No GCC changes are needed.
>
> Is the next step for me to do another round of review on this branch?
>
Yes, here is the patch.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Add-__sigsetjmp_cancel-and-__setjmp_cancel.patch
Type: text/x-patch
Size: 26707 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20180315/37eb3535/attachment.bin>
More information about the Libc-alpha
mailing list