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: <f797e5ac-a29a-0eb0-89c8-ff0a9f537ccf@c-s.fr>
Date:   Thu, 16 Apr 2020 14:41:56 +0200
From:   Christophe Leroy <christophe.leroy@....fr>
To:     Segher Boessenkool <segher@...nel.crashing.org>
Cc:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>, npiggin@...il.com,
        linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2] powerpc/uaccess: Implement unsafe_put_user() using
 'asm goto'



Le 16/04/2020 à 00:37, Segher Boessenkool a écrit :
> Hi!
> 
> On Wed, Apr 15, 2020 at 09:25:59AM +0000, Christophe Leroy wrote:
>> +#define __put_user_goto(x, ptr, label) \
>> +	__put_user_nocheck_goto((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)), label)
> 
> This line gets too long, can you break it up somehow?

This line has 86 chars.

powerpc arch tolerates lines with up to 90 chars, see 
arch/powerpc/tools/checkpatch.sh

> 
>> +#define __put_user_asm_goto(x, addr, label, op)			\
>> +	asm volatile goto(					\
>> +		"1:	" op "%U1%X1 %0,%1	# put_user\n"	\
>> +		EX_TABLE(1b, %l2)				\
>> +		:						\
>> +		: "r" (x), "m" (*addr)				\
>> +		:						\
>> +		: label)
> 
> Same "%Un" problem as in the other patch.  You could use "m<>" here,
> but maybe just dropping "%Un" is better.

Ok.

I kept it to be consistent with the other patch.

> 
>> +#ifdef __powerpc64__
>> +#define __put_user_asm2_goto(x, ptr, label)			\
>> +	__put_user_asm_goto(x, ptr, label, "std")
>> +#else /* __powerpc64__ */
>> +#define __put_user_asm2_goto(x, addr, label)			\
>> +	asm volatile goto(					\
>> +		"1:	stw%U1%X1 %0, %1\n"			\
>> +		"2:	stw%U1%X1 %L0, %L1\n"			\
>> +		EX_TABLE(1b, %l2)				\
>> +		EX_TABLE(2b, %l2)				\
>> +		:						\
>> +		: "r" (x), "m" (*addr)				\
>> +		:						\
>> +		: label)
>> +#endif /* __powerpc64__ */
> 
> Here, you should drop it for sure.

Done.

Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ