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: Tue, 28 May 2024 17:30:13 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Arnd Bergmann" <arnd@...nel.org>,
 "Catalin Marinas" <catalin.marinas@....com>, "Will Deacon" <will@...nel.org>,
 "Jason Gunthorpe" <jgg@...pe.ca>
Cc: "Valentin Schneider" <vschneid@...hat.com>,
 "Mark Rutland" <mark.rutland@....com>, "Baoquan He" <bhe@...hat.com>,
 "Peter Zijlstra" <peterz@...radead.org>,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64/io: add constant-argument check

On Tue, May 28, 2024, at 14:08, Arnd Bergmann wrote:

> diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
> index 4ff0ae3f6d66..44913f227060 100644
> --- a/arch/arm64/include/asm/io.h
> +++ b/arch/arm64/include/asm/io.h
> @@ -199,7 +199,8 @@ void __iowrite32_copy_full(void __iomem *to, const 
> void *from, size_t count);
>  static inline void __const_iowrite32_copy(void __iomem *to, const void 
> *from,
>  					  size_t count)
>  {
> -	if (count == 8 || count == 4 || count == 2 || count == 1) {
> +	if (__builtin_constant_p(count) &&
> +	    (count == 8 || count == 4 || count == 2 || count == 1)) {
>  		__const_memcpy_toio_aligned32(to, from, count);
>  		dgh();
>  	} else {

I ran into the same issue on __const_iowrite64_copy()
now, will send an updated patch. I also noticed that
the __iowrite32_copy() and __iowrite64_copy() look
redundant after my change, so I wonder if we should
just remove those and rename __const_iowrite32_copy()
and __const_iowrite64_copy() accordingly.

    Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ