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]
Date:   Wed, 15 Jan 2020 07:15:44 +0100
From:   Christophe Leroy <christophe.leroy@....fr>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>, arnd@...db.de,
        vincenzo.frascino@....com, luto@...nel.org
Cc:     linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
        x86@...nel.org
Subject: Re: [RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data
 pointer



Le 15/01/2020 à 00:06, Thomas Gleixner a écrit :
> Christophe Leroy <christophe.leroy@....fr> writes:
>>   
>>   static __maybe_unused int
>> +#ifdef VDSO_GETS_VD_PTR_FROM_ARCH
>> +__cvdso_clock_gettime_common(const struct vdso_data *vd, clockid_t clock,
>> +		      struct __kernel_timespec *ts)
>> +{
>> +#else
>>   __cvdso_clock_gettime_common(clockid_t clock, struct __kernel_timespec *ts)
>>   {
>>   	const struct vdso_data *vd = __arch_get_vdso_data();
>> +#endif
>>   	u32 msk;
> 
> If we do that, then there is no point in propagating this to the inner
> functions. It's perfectly fine to have this distinction at the outermost
> level.

In v2, I did it at the arch level (see 
https://patchwork.ozlabs.org/patch/1214983/). Andy was concerned about 
it being suboptimal for arches which (unlike powerpc) have PC related 
data addressing mode.

Wouldn't it be the same issue if doing it at the outermost level of 
generic VDSO ?

> 
> As a related question, I noticed that you keep all that ASM voodoo in
> the PPC specific code which provides the actual entry points. Is that
> ASM code really still necessary? All current users of the generic VDSO
> just do something like:
> 
> int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
> {
>          return __cvdso_clock_gettime(clock, ts);
> }
> 
> in the architecture code. Is there a reason why this can't work on PPC?

The problem with powerpc is that VDSO functions have to (just like 
system calls) set the SO bit in CR register in case of error, or clear 
it if no error. There is no way to do that from the C function, because 
there is no way to tell GCC to not play up with CR register on function 
return.

Refer discussion at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92769

Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ