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] [day] [month] [year] [list]
Message-Id: <98dc5b85-fdf4-4664-8cca-e6c9e1f8eb14@app.fastmail.com>
Date: Tue, 10 Sep 2024 15:05:16 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Christophe Leroy" <christophe.leroy@...roup.eu>,
 "Vincenzo Frascino" <vincenzo.frascino@....com>,
 linux-kernel@...r.kernel.org, Linux-Arch <linux-arch@...r.kernel.org>,
 linux-mm@...ck.org
Cc: "Andy Lutomirski" <luto@...nel.org>,
 "Thomas Gleixner" <tglx@...utronix.de>,
 "Jason A . Donenfeld" <Jason@...c4.com>,
 "Michael Ellerman" <mpe@...erman.id.au>,
 "Nicholas Piggin" <npiggin@...il.com>, "Naveen N Rao" <naveen@...nel.org>,
 "Ingo Molnar" <mingo@...hat.com>, "Borislav Petkov" <bp@...en8.de>,
 "Dave Hansen" <dave.hansen@...ux.intel.com>,
 "H. Peter Anvin" <hpa@...or.com>, "Theodore Ts'o" <tytso@....edu>,
 "Andrew Morton" <akpm@...ux-foundation.org>,
 "Steven Rostedt" <rostedt@...dmis.org>,
 "Masami Hiramatsu" <mhiramat@...nel.org>,
 "Mathieu Desnoyers" <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 3/9] x86: vdso: Introduce asm/vdso/page.h

On Tue, Sep 10, 2024, at 12:28, Christophe Leroy wrote:
> Le 08/09/2024 à 22:48, Arnd Bergmann a écrit :
>> On Fri, Sep 6, 2024, at 18:40, Christophe Leroy wrote:
>
> uiomem->addr is a phys_addr_t
> r->start is a ressource_size_t hence a phys_addr_t
>
> And phys_addr_t is defined as:
>
> 	#ifdef CONFIG_PHYS_ADDR_T_64BIT
> 	typedef u64 phys_addr_t;
> 	#else
> 	typedef u32 phys_addr_t;
> 	#endif
>
> On a 32 bits platform, UL is unsigned 32 bits, so the r->start & 
> PAGE_MASK will and r->start with 0x00000000fffff000
>
> That is wrong.

Right, I see. So out of the five 32-bit architectures with a
64-bit phys_addr_t, arc seems to ignore this problem, x86 has
a separate PHYSICAL_PAGE_MASK for its internal uses and
the other three have the definition you mention as

> 	(~((1 << PAGE_SHIFT) - 1))

And this is only documented properly on powerpc.

How about making the common definition this?

#ifdef CONFIG_PHYS_ADDR_T_64BIT
#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
#else
#define PAGE_MASK (~(PAGE_SIZE-1))
#endif

That keeps it unchanged for everything other than arc
and x86-32, and hopefully fixes the currently behavior
on those two.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ