lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1895296081.51093.1591188035688.JavaMail.zimbra@efficios.com>
Date:   Wed, 3 Jun 2020 08:40:35 -0400 (EDT)
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Florian Weimer <fweimer@...hat.com>
Cc:     carlos <carlos@...hat.com>, Joseph Myers <joseph@...esourcery.com>,
        Szabolcs Nagy <szabolcs.nagy@....com>,
        libc-alpha <libc-alpha@...rceware.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ben Maurer <bmaurer@...com>,
        Peter Zijlstra <peterz@...radead.org>,
        Paul <paulmck@...ux.vnet.ibm.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Will Deacon <will.deacon@....com>,
        Dave Watson <davejwatson@...com>, Paul Turner <pjt@...gle.com>,
        Rich Felker <dalias@...c.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-api <linux-api@...r.kernel.org>
Subject: Re: [PATCH glibc 1/3] glibc: Perform rseq registration at C startup
 and thread creation (v20)



----- On Jun 3, 2020, at 8:31 AM, Florian Weimer fweimer@...hat.com wrote:

> * Mathieu Desnoyers:
> 
>> ----- On Jun 3, 2020, at 8:05 AM, Florian Weimer fweimer@...hat.com wrote:
>>
>>> * Mathieu Desnoyers:
>>> 
>>>> +#ifdef __cplusplus
>>>> +# if  __cplusplus >= 201103L
>>>> +#  define __rseq_static_assert(expr, diagnostic) static_assert (expr,
>>>> diagnostic)
>>>> +#  define __rseq_alignof(type)                   alignof (type)
>>>> +#  define __rseq_alignas(x)                      alignas (x)
>>>> +#  define __rseq_tls_storage_class               thread_local
>>>> +# endif
>>>> +#elif (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) >= 201112L
>>>> +# define __rseq_static_assert(expr, diagnostic)  _Static_assert (expr,
>>>> diagnostic)
>>>> +# define __rseq_alignof(type)                    _Alignof (type)
>>>> +# define __rseq_alignas(x)                       _Alignas (x)
>>>> +# define __rseq_tls_storage_class                _Thread_local
>>>> +#endif
>>> 
>>> This does not seem to work.  I get this with GCC 9:
>>> 
>>> In file included from /tmp/cih_test_gsrKbC.cc:8:0:
>>> ../sysdeps/unix/sysv/linux/sys/rseq.h:42:50: error: attribute ignored
>>> [-Werror=attributes]
>>> #  define __rseq_alignas(x)                      alignas (x)
>>>                                                  ^
>>> ../sysdeps/unix/sysv/linux/sys/rseq.h:122:14: note: in expansion of macro
>>> ‘__rseq_alignas’
>>>     uint32_t __rseq_alignas (32) version;
>>>              ^
>>
>> Is that when compiling C or C++ code ? If it's C code, I would expect
>> "_Alignas" to be used, not "alignas".
>>
>> Which exact version of gcc do you use ?
> 
> C++ code.  CXX was set to this compiler at configure time:
> 
> gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)

I think I found the culprit: it should be:

__rseq_alignas (32) uint32_t version;

rather than the other way around.

> 
>>> In any case, these changes really have to go into the UAPI header first.
>>> Only the __thread handling should remain.  Otherwise, we'll have a tough
>>> situation on our hands changing the UAPI header, without introducing
>>> macro definition conflicts.  I'd suggest to stick to the aligned
>>> attribute for the time being, like the current UAPI headers.

OK, so I just remove the __rseq_alignas for now and use "aligned()" instead
like the UAPI header. I plan to keep the other macros for now.

>>
>> OK. Should I do that in a separate patch, or you do it on top of my patchset,
>> or should I re-spin another round of the series ?
> 
> I think the initial commit should mirror the current UAPI header
> contents.
> 
> Keep the macros for the UAPI patch though. 8-)  We can pick up these
> changes once they have been merged into Linux.

OK,

Thanks!

Mathieu

> 
> Thanks,
> Florian

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ