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: <f82e3092-31ab-4ceb-a51f-208d13e7b2ec@linuxfoundation.org>
Date: Fri, 18 Jul 2025 15:03:43 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: paulmck@...nel.org, Christian Brauner <brauner@...nel.org>,
 Shuah Khan <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH RFC] selftests/pidfd: Fix duplicate-symbol warnings for
 SCHED_ CPP symbols

On 7/14/25 17:01, Paul E. McKenney wrote:
> The pidfd selftests run in userspace and include both userspace and kernel
> header files.  On some distros (for example, CentOS), this results in
> duplicate-symbol warnings in allmodconfig builds, while on other distros
> (for example, Ubuntu) it does not.  (This happens in recent -next trees,
> including next-20250714.)
> 
> Therefore, use #undef to get rid of the userspace definitions in favor
> of the kernel definitions.
> 
> Other ways of handling this include splitting up the selftest code so
> that the userspace definitions go into one translation unit and the
> kernel definitions into another (which might or might not be feasible)
> or to adjust compiler command-line options to suppress the warnings
> (which might or might not be desirable).
> 
> Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> Cc: Christian Brauner <brauner@...nel.org>
> Cc: Shuah Khan <shuah@...nel.org>
> Cc: <linux-kselftest@...r.kernel.org>
> 
> ---
>   pidfd.h |    4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h
> index efd74063126eb..6ff495398e872 100644
> --- a/tools/testing/selftests/pidfd/pidfd.h
> +++ b/tools/testing/selftests/pidfd/pidfd.h
> @@ -16,6 +16,10 @@
>   #include <sys/types.h>
>   #include <sys/wait.h>
>   

Please add comments here about why we are adding this so there
won't be any confusion later.

> +#undef SCHED_NORMAL
> +#undef SCHED_FLAG_KEEP_ALL
> +#undef SCHED_FLAG_UTIL_CLAMP
> +
>   #include "../kselftest.h"
>   #include "../clone3/clone3_selftests.h"
>   

With that change:

Reviewed-by: Shuah Khan <skhan@...uxfoundation.org>

I am assuming this will go through Christian's tree. If not I can
take it through mine.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ