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-next>] [day] [month] [year] [list]
Message-Id: <20250203-parse_vdso-nolibc-v1-0-9cb6268d77be@linutronix.de>
Date: Mon, 03 Feb 2025 10:05:01 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Kees Cook <kees@...nel.org>, Eric Biederman <ebiederm@...ssion.com>, 
 Shuah Khan <shuah@...nel.org>, Nathan Chancellor <nathan@...nel.org>, 
 Nick Desaulniers <ndesaulniers@...gle.com>, 
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>, 
 Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, 
 Vincenzo Frascino <vincenzo.frascino@....com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
 linux-kselftest@...r.kernel.org, llvm@...ts.linux.dev, 
 Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 00/16] selftests: vDSO: parse_vdso: Make compatible with
 nolibc

For testing the functionality of the vDSO, it is necessary to build
userspace programs for multiple different architectures.
It is additional work to acquire matching userspace cross-compilers with
full C libraries and then building root images out of those.
The kernel tree already contains nolibc, a small, header-only C library.
By using it, it is possible to build userspace programs without any
additional dependencies.
For example the kernel.org crosstools or multi-target clang can be used
to build test programs for a multitude of architectures.
While nolibc is very limited, it is enough for many selftests.
With some minor adjustments it is possible to make parse_vdso.c
compatible with nolibc.
As an example, vdso_standalone_test_x86 is now built from the same C
code as the regular vdso_test_gettimeofday, while still being completely
standalone.

This should probably go through the kselftest tree.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
Thomas Weißschuh (16):
      MAINTAINERS: Add vDSO selftests
      elf, uapi: Add definition for STN_UNDEF
      elf, uapi: Add definition for DT_GNU_HASH
      elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK
      elf, uapi: Add type ElfXX_Versym
      elf, uapi: Add types ElfXX_Verdef and ElfXX_Veraux
      tools/include: Add uapi/linux/elf.h
      selftests: Add headers target
      selftests: vDSO: vdso_standalone_test_x86: Use vdso_init_form_sysinfo_ehdr
      selftests: vDSO: parse_vdso: Drop vdso_init_from_auxv()
      selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers
      selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX
      selftests: vDSO: parse_vdso: Make compatible with nolibc
      selftests: vDSO: vdso_test_gettimeofday: Clean up includes
      selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc
      selftests: vDSO: vdso_standalone_test_x86: Switch to nolibc

 MAINTAINERS                                        |   1 +
 include/uapi/linux/elf.h                           |  38 ++
 tools/include/uapi/linux/elf.h                     | 524 +++++++++++++++++++++
 tools/testing/selftests/lib.mk                     |   5 +-
 tools/testing/selftests/vDSO/Makefile              |  11 +-
 tools/testing/selftests/vDSO/parse_vdso.c          |  21 +-
 tools/testing/selftests/vDSO/parse_vdso.h          |   1 -
 .../selftests/vDSO/vdso_standalone_test_x86.c      | 143 +-----
 .../selftests/vDSO/vdso_test_gettimeofday.c        |   4 +-
 9 files changed, 584 insertions(+), 164 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20241017-parse_vdso-nolibc-e069baa7ff48

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@...utronix.de>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ