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: <937c99b3-3837-4510-be65-4eca3b280ce2@csgroup.eu>
Date: Mon, 3 Feb 2025 16:43:22 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: 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>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
 llvm@...ts.linux.dev
Subject: Re: [PATCH 00/16] selftests: vDSO: parse_vdso: Make compatible with
 nolibc



Le 03/02/2025 à 14:50, Thomas Weißschuh a écrit :
> On Mon, Feb 03, 2025 at 12:23:29PM +0100, Christophe Leroy wrote:
>> Le 03/02/2025 à 10:05, Thomas Weißschuh a écrit :
>>> 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.
>>
>> Not sure what are the expectations with this series.
> 
> In general it should also work for PPC,
> thanks for testing it.
> 
>> I gave it a try with vdso_test_gettimeofday and get the following:
>>
>> $ powerpc64-linux-gcc -nostdlib -nostdinc -ffreestanding
>> -fno-asynchronous-unwind-tables -fno-stack-protector -include /home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/nolibc/nolibc.h -I/home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/nolibc/
>> -isystem
>> /home/chleroy/linux-powerpc/tools/testing/selftests/../../../usr/include
>> -std=gnu99 -O2 -D_GNU_SOURCE= -isystem /home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/uapi
>> vdso_test_gettimeofday.c parse_vdso.c  -o /home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_gettimeofday
>>
>> make: Entering directory
>> '/home/chleroy/linux-powerpc/tools/testing/selftests/vDSO'
>> powerpc64-linux-gcc -nostdlib -nostdinc -ffreestanding
>> -fno-asynchronous-unwind-tables -fno-stack-protector -include /home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/nolibc/nolibc.h -I/home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/nolibc/
>> -isystem
>> /home/chleroy/linux-powerpc/tools/testing/selftests/../../../usr/include
>> -std=gnu99 -O2 -D_GNU_SOURCE= -isystem /home/chleroy/linux-powerpc/tools/testing/selftests/../../../tools/include/uapi
>> vdso_test_gettimeofday.c parse_vdso.c  -o /home/chleroy/linux-powerpc/tools/testing/selftests/vDSO/vdso_test_gettimeofday
> 
> This log is confusing. It contains traces of "make" output but no "make"
> invocation. I'm also not sure if there were two different compilations
> or only one. Can you give the full commandline?
> For your testing it should be enough to enable
> "vdso_test_standalone_x86" in the Makefile for PPC.

Well, yes I copied/pasted too much.

I made some hacky modifications to the Makefile but I forgot the '| 
header' pattern. With it added it works as expected.

Do you have any plan to get it work with nolibc for all test programs in 
selftests/vDSO, not only the standalone x86 test ?

Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ