[PATCH v2 04/21] nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue May 8 17:56:00 GMT 2018



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.



More information about the Libc-alpha mailing list