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: <aLIvH06e1XDFz9lh@google.com>
Date: Fri, 29 Aug 2025 15:52:15 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Aqib Faruqui <aqibaf@...zon.com>
Cc: Kees Cook <kees@...nel.org>, Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>, 
	Shuah Khan <shuah@...nel.org>, Christian Brauner <brauner@...nel.org>, linux-kselftest@...r.kernel.org, 
	linux-kernel@...r.kernel.org, nh-open-source@...zon.com
Subject: Re: [PATCH 1/9] KVM: selftests: Add pidfd_open syscall number fallback

Subject says KVM, but I don't see anything KVM related in here.  I don't think
any of the KVM selftests even use pidfd_open() directly.

On Fri, Aug 29, 2025, Aqib Faruqui wrote:
> The kselftest-harness uses pidfd_open() for test timeout handling, but
> non-glibc C library headers may not define this syscall number.
> 
> Add architecture-specific fallback definitions to pidfd.h, including
> support for Alpha (544) and other architectures (434). Update
> kselftest_harness.h to include pidfd.h for the syscall definitions.

This should probably be split into two patches:

  selftests: harness: Include pidfd.h to get syscall definitions from tools/

and

  selftests/pidfd: Add architecture-specific fallback definitions for pidfd_open

as there are two distinct changes here.  And kselftest_harness.h also tends to be
a finicky little bugger, isolating changes to that file is almost always a good
idea, no matter how trivial they might seem.

> Signed-off-by: Aqib Faruqui <aqibaf@...zon.com>
> ---
>  tools/testing/selftests/kselftest_harness.h | 1 +
>  tools/testing/selftests/pidfd/pidfd.h       | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 2925e47db..1dd3e5a1b 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -69,6 +69,7 @@
>  #include <unistd.h>
>  
>  #include "kselftest.h"
> +#include "pidfd/pidfd.h"
>  
>  #define TEST_TIMEOUT_DEFAULT 30
>  
> diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h
> index f87993def..c373ff18e 100644
> --- a/tools/testing/selftests/pidfd/pidfd.h
> +++ b/tools/testing/selftests/pidfd/pidfd.h
> @@ -45,8 +45,12 @@
>  #endif
>  
>  #ifndef __NR_pidfd_open
> +#ifdef __alpha__
> +#define __NR_pidfd_open 544
> +#else
>  #define __NR_pidfd_open 434
>  #endif
> +#endif
>  
>  #ifndef __NR_pidfd_send_signal
>  #define __NR_pidfd_send_signal 424
> -- 
> 2.47.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ