This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tests that use clone directly race against SSE register save/restore.


On Tue, Jul 21, 2015 at 6:47 AM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 07/20/2015 03:39 PM, Carlos O'Donell wrote:
>> On 07/20/2015 02:27 PM, H.J. Lu wrote:
>>>> And reproducible, but only in this CLONE_VM case.
>>>
>>> See:
>>>
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=11214
>>>
>>
>> Excellent. Glad to see we've fixed it for one test case.
>> Do you recommend we do the same thing for all test cases
>> that use CLONE_VM like this?
>
> Given that tst-getpid1 can accept arbitrary TEST_CLONE_FLAGS
> is there any reason not to just build the two of them with
> -Wl,-z,now? This makes them safer no matter what kind of
> experimenting your're doing with clone flags.
>
> Any objection?
>
> Cheers,
> Carlos.
>
> 2015-07-21  Carlos O'Donell  <carlos@redhat.com>
>
>        * sysdeps/unix/sysv/linux/Makefile: Define tst-getpid1-ENV.
>
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index bfbabd4..27515d2 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -197,5 +197,8 @@ tests += tst-setgetname tst-align-clone tst-getpid1 tst-getpid2
>  # In this test, we create a CLONE_VM "thread" that shares TLS storage
>  # with the original thread. Both threads then race in ld.so with lazy PLT
>  # resolution. Avoid this race by disabling lazy binding. BZ #11214.
> -tst-getpid2-ENV = LD_BIND_NOW=1
> +LDFLAGS-tst-getpid2 += -Wl,-z,now
> +# Similarly we may be run with arbitrary TEST_CLONE_FLAGS set by the machine
> +# and thus we should protect against CLONE_VM being set by avoiding lazy PLT.
> +LDFLAGS-tst-getpid1 += -Wl,-z,now
>  endif
> ---

Looks good to me.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]