Re: [patch V5 16/16] [RFC] vdso, x86: Expose vdso.so.dbg through sysfs
From: Thomas Weißschuh
Date: Tue Jun 02 2026 - 06:40:02 EST
On 2026-06-02 11:10:25+0200, Thomas Gleixner wrote:
> Finding the debug version of the VDSO is not trivial as there is no common
> scheme where it is placed. That's especially problematic for CI testing.
>
> The VDSO futex unlock mechanism requires for testing to have access to the
> inner labels of the unlock assembly, which are only accessible via the
> debug so.
>
> Also for general debugging purposes it's conveniant to have access to the
> debug VDSO at a well defined place.
>
> The files are placed in /sys/kernel/vdso/ and named vdso32.so.dbg,
> vdso64.so.dbg, vdsox32.so.dbg.
How is a user supposed to find the correct one for a given task?
As currently proposed that requires architecture-specific logic.
What about mirroring CONFIG_IKCONFIG and CONFIG_IKHEADERS, packaging
the output of 'make vdso_install' as an archive and embedding that
into the kernel.
It has the following advantages:
* Can be loaded on-demand from a module.
* Does not require additional (per-architecture) code.
* Contains build-id symlinks which can be followed automatically to find
a task's debug vDSO.
Currently CONFIG_IKHEADERS only provide the compressed archives, and not
a directly usable directory, though. That could be fine here, too.
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/include/asm/vdso.h | 3 +++
> arch/x86/tools/vdso2c.c | 15 ++++++++++-----
> arch/x86/tools/vdso2c.h | 32 ++++++++++++++++++++++++++++++--
> include/vdso/sysfs.h | 7 +++++++
> lib/vdso/Kconfig | 6 ++++++
> lib/vdso/Makefile | 3 ++-
> lib/vdso/sysfs.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 8 files changed, 103 insertions(+), 8 deletions(-)
(...)
> --- /dev/null
> +++ b/include/vdso/sysfs.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __VDSO_SYSFS_H
> +#define __VDSO_SYSFS_H
> +
> +int vdso_sysfs_init_image(const char *name, void *addr, unsigned int size);
> +
> +#endif /* __VDSO_SYSFS_H */
This breaks the vdso/ header namespace.
For the datastore I went with include/linux/vdso_datastore.h.
Maye we can use include/linux/vdso/ ?
(...)
Thomas