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: <b870aa47-5ed4-4dcf-a407-eca83d1733d8@app.fastmail.com>
Date: Fri, 07 Nov 2025 16:17:14 -0800
From: "Andy Lutomirski" <luto@...nel.org>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
 "Thomas Gleixner" <tglx@...utronix.de>,
 "Vincenzo Frascino" <vincenzo.frascino@....com>,
 "Arnd Bergmann" <arnd@...db.de>, "David S. Miller" <davem@...emloft.net>,
 "Andreas Larsson" <andreas@...sler.com>,
 "Nick Alcock" <nick.alcock@...cle.com>,
 "John Stultz" <jstultz@...gle.com>, "Stephen Boyd" <sboyd@...nel.org>,
 "John Paul Adrian Glaubitz" <glaubitz@...sik.fu-berlin.de>,
 "Shuah Khan" <shuah@...nel.org>,
 "Catalin Marinas" <catalin.marinas@....com>,
 "Will Deacon" <will@...nel.org>, "Theodore Ts'o" <tytso@....edu>,
 "Jason A. Donenfeld" <Jason@...c4.com>,
 "Russell King (Oracle)" <linux@...linux.org.uk>,
 "Madhavan Srinivasan" <maddy@...ux.ibm.com>,
 "Michael Ellerman" <mpe@...erman.id.au>,
 "Nicholas Piggin" <npiggin@...il.com>,
 "Christophe Leroy" <christophe.leroy@...roup.eu>,
 "Huacai Chen" <chenhuacai@...nel.org>, "WANG Xuerui" <kernel@...0n.name>,
 "Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
 "Heiko Carstens" <hca@...ux.ibm.com>,
 "Vasily Gorbik" <gor@...ux.ibm.com>,
 "Alexander Gordeev" <agordeev@...ux.ibm.com>,
 "Christian Borntraeger" <borntraeger@...ux.ibm.com>,
 "Sven Schnelle" <svens@...ux.ibm.com>,
 "Shannon Nelson" <sln@...main.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
 sparclinux@...r.kernel.org, linux-kselftest@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
 loongarch@...ts.linux.dev, linux-mips@...r.kernel.org,
 linux-s390@...r.kernel.org, "Arnd Bergmann" <arnd@...nel.org>
Subject: Re: [PATCH v5 00/34] sparc64: vdso: Switch to the generic vDSO library


On Thu, Nov 6, 2025, at 2:01 AM, Thomas Weißschuh wrote:
> The generic vDSO provides a lot common functionality shared between
> different architectures. SPARC is the last architecture not using it,
> preventing some necessary code cleanup.
>
> Make use of the generic infrastructure.
>
> Follow-up to and replacement for Arnd's SPARC vDSO removal patches:
> https://lore.kernel.org/lkml/20250707144726.4008707-1-arnd@kernel.org/
>
> SPARC64 can not map .bss into userspace, so the vDSO datapages are
> switched over to be allocated dynamically. This requires changes to the
> s390 and random subsystem vDSO initialization as preparation.
> The random subsystem changes in turn require some cleanup of the vDSO
> headers to not end up as ugly #ifdef mess.
>

I hate to say it, but this patch series seems like a step backwards.  You're adding a whole lot of complexity and opportunity for screwups (boot failure? corruption?) to support SPARC, where other architectures have no problem with the existing code.  And this complexity appears to infect basically every kernel subsystem that supplies data to the vDSO.

Can you at least explain what the problem is and maybe give some discussion of why SPARC has no workaround available?  The closest I found was this bit from "[PATCH v4 24/35] vdso/datastore: Allocate data pages dynamically":

> Allocating the datapages as part of the kernel image does not work on
SPARC. It is also problematic with regards to dcache aliasing as there is
no guarantee that the virtual addresses used by the kernel are compatible
with those used by userspace.

Now I'm not an expert on any architecture that has these aliasing (coloring?) issues, but from my limited understanding, it ought to be possible to choose a correctly colored address to map the vdso data given where it's being mapped from.  If there's an issue with gathering a bunch of basically arbitrarily relatively positioned physical pages into their necessary arrangement in usermode, you could presumably fix it either with some linker script magic or by rearranging the C code to stick everything into a multipage structure.

Or maybe you could arrange to allocate all these pages during early boot and to fudge up some relocation to get all the existing generic code to find them.  Or create some pointers that all the generic code will use that, on non-sparc architectures, will be statically populated with the right addresses by the linker.  IOW, conceptually,

struct the_type some_vdso_thing;

could change to:

const struct the_type some_vdso_thing = &the_actual_data;

and SPARC could fix up the initialization of the pointer.  And generic code would use the pointer instead of the_actual_data.

If you really really really need to have non-arch-specific kernel C code running before the vdso data is allocated, can you give a very clear explanation of what, exactly, is wrong on sparc?  And maybe put that explanation into an appropriate comment somewhere so that future kernel programmers don't look at the headers and the code and think "wow, what I mess -- I bet I can clean this up by using statically allocated data".

(Can SPARC really not map things that existed during early boot into userspace?)

--Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ