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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250911042910.2834585-1-tiwei.bie@linux.dev>
Date: Thu, 11 Sep 2025 12:29:10 +0800
From: Tiwei Bie <tiwei.bie@...ux.dev>
To: johannes@...solutions.net
Cc: richard@....at,
	anton.ivanov@...bridgegreys.com,
	benjamin@...solutions.net,
	arnd@...db.de,
	linux-um@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	tiwei.btw@...group.com,
	tiwei.bie@...ux.dev
Subject: Re: [PATCH v2 03/10] um: vdso: Implement __vdso_getcpu() via syscall

On Wed, 10 Sep 2025 13:59:02 +0200, Johannes Berg wrote:
> On Sun, 2025-08-10 at 13:51 +0800, Tiwei Bie wrote:
> > From: Tiwei Bie <tiwei.btw@...group.com>
> > 
> > We are going to support SMP in UML, so we can not hard code
> > the CPU and NUMA node in __vdso_getcpu() anymore.
> 
> Correct. But does that mean we actually have to implement it via syscall
> in the VDSO? That seems a bit odd? ARM doesn't seem to have getcpu in
> the VDSO at all, for example, so could we do the same and just remove
> it?

Good idea. I checked the implementations in glibc and musl, and
they automatically fall back to the syscall when __vdso_getcpu is
not available:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sysdep-vdso.h;h=5a33871872da9ccef36293c3ca5eba6503f956e6;hb=HEAD#l36
https://git.musl-libc.org/cgit/musl/tree/src/sched/sched_getcpu.c?h=v1.2.5#n32

I will just remove it in the next version.

Regards,
Tiwei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ