This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 04/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Zack Weinberg <zackw at panix dot com>, libc-alpha at sourceware dot org
- Date: Tue, 8 May 2018 14:55:59 -0300
- Subject: Re: [PATCH v2 04/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
- References: <20180507024909.5598-1-zackw@panix.com> <20180507024909.5598-4-zackw@panix.com>
On 06/05/2018 23:49, Zack Weinberg wrote:
> On 26 Feb 2018, Adhemerval Zanella wrote:
>> This patches adds the x86_64 modification required for the BZ#12683.
>> It basically provide the required ucontext_get_pc symbol and remove
>> the arch-specific libc-cancellation implementations.
>
> These changes all look fine to me.
>
>> lock;orl $4, %fs:776
>>
>> Where with patch changes it now compiles to:
>>
>> mov %fs:16,%rax
>> lock;orl $4, 776(%rax)
>
> That might actually be faster on some microarchitectures due to not
> having multiple unusual prefixes on one instruction. I wouldn't worry
> about it.
>
>> In fact all x86_64 THREAD_ATOMIC_* macros
>> do not respect the input descr and possible will fail when used with
>> a 'descr' difference than THREAD_SELF.
>
> Maybe we should correct or remove all of them, then? They sound like
> they're bugs waiting to happen.
>
> zw
>
Right, I will fix in on an extra patch then.