selftests: complete kselftest include centralizationThis follow-up patch completes centralization of kselftest.h andksefltest_harness.h includes in remaining seltests files, replacing allrelative
selftests: complete kselftest include centralizationThis follow-up patch completes centralization of kselftest.h andksefltest_harness.h includes in remaining seltests files, replacing allrelative paths with a non-relative paths using shared -I include path inlib.mkTested with gcc-13.3 and clang-18.1, and cross-compiled successfully onriscv, arm64, x86_64 and powerpc arch.[reddybalavignesh9979@gmail.com: add selftests include path for kselftest.h] Link: https://lkml.kernel.org/r/20251017090201.317521-1-reddybalavignesh9979@gmail.comLink: https://lkml.kernel.org/r/20251016104409.68985-1-reddybalavignesh9979@gmail.comSigned-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>Suggested-by: Andrew Morton <akpm@linux-foundation.org>Link: https://lore.kernel.org/lkml/20250820143954.33d95635e504e94df01930d0@linux-foundation.org/Reviewed-by: Wei Yang <richard.weiyang@gmail.com>Cc: David Hildenbrand <david@redhat.com>Cc: David S. Miller <davem@davemloft.net>Cc: Eric Dumazet <edumazet@google.com>Cc: Günther Noack <gnoack@google.com>Cc: Jakub Kacinski <kuba@kernel.org>Cc: Liam Howlett <liam.howlett@oracle.com>Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>Cc: Michal Hocko <mhocko@suse.com>Cc: Mickael Salaun <mic@digikod.net>Cc: Ming Lei <ming.lei@redhat.com>Cc: Paolo Abeni <pabeni@redhat.com>Cc: Shuah Khan <shuah@kernel.org>Cc: Simon Horman <horms@kernel.org>Cc: Suren Baghdasaryan <surenb@google.com>Cc: Vlastimil Babka <vbabka@suse.cz>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
show more ...
selftests: pid_namespace: add missing sys/mount.h include in pid_max.cFix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40): - add missing sys/mount.h includeFixes: pid_max.c: In funct
selftests: pid_namespace: add missing sys/mount.h include in pid_max.cFix compile on openSUSE Tumbleweed (gcc-14.2.1, glibc-2.40): - add missing sys/mount.h includeFixes: pid_max.c: In function ‘pid_max_cb’: pid_max.c:42:15: error: implicit declaration of function ‘mount’ [-Wimplicit-function-declaration] 42 | ret = mount("", "/", NULL, MS_PRIVATE | MS_REC, 0); | ^~~~~Link: https://lore.kernel.org/r/20250115105211.390370-3-ps.report@gmx.netSigned-off-by: Peter Seiderer <ps.report@gmx.net>Reviewed-by: T.J. Mercier <tjmercier@google.com>Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tests/pid_namespace: add pid_max testsSigned-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>Link: https://lore.kernel.org/r/20241122132459.135120-3-aleksandr.mikhalitsyn@canoni
tests/pid_namespace: add pid_max testsSigned-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>Link: https://lore.kernel.org/r/20241122132459.135120-3-aleksandr.mikhalitsyn@canonical.comSigned-off-by: Christian Brauner <brauner@kernel.org>
selftests: pid_namespace: Fix incorrect kernel headers search pathUse $(KHDR_INCLUDES) as lookup path for kernel headers. This preventsbuilding against kernel headers from the build environment in
selftests: pid_namespace: Fix incorrect kernel headers search pathUse $(KHDR_INCLUDES) as lookup path for kernel headers. This preventsbuilding against kernel headers from the build environment in scenarioswhere kernel headers are installed into a specific output directory(O=...).Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>Cc: Shuah Khan <shuah@kernel.org>Cc: linux-kselftest@vger.kernel.orgCc: Ingo Molnar <mingo@redhat.com>Cc: <stable@vger.kernel.org> # 5.18+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
selftests: fix header dependency for pid_namespace selftestsThe way the test target was defined before, when building with clang weget a command line like this:clang -Wall -Werror -g -I../../../
selftests: fix header dependency for pid_namespace selftestsThe way the test target was defined before, when building with clang weget a command line like this:clang -Wall -Werror -g -I../../../../usr/include/ \ regression_enomem.c ../pidfd/pidfd.h -o regression_enomemThis yields an error, because clang thinks we want to produce both a *.ofile, as well as a precompiled header:clang: error: cannot specify -o when generating multiple output filesgcc, for whatever reason, doesn't exhibit the same behavior which Isuspect is why the problem wasn't noticed before.This can be fixed simply by using the LOCAL_HDRS infrastructure theselftests lib.mk provides. It does the right think and marks the targetas depending on the header (so if the header changes, we rebuild), butit filters the header out of the compiler command line, so we don't getthe error described above.Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>Reviewed-by: Christian Brauner <brauner@kernel.org>Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
selftests: Remove unneeded selftest API headersRemove unused includes of the kselftest.h header.Acked-by: Christian Brauner <christian.brauner@ubuntu.com>Signed-off-by: Kees Cook <keescook@chrom
selftests: Remove unneeded selftest API headersRemove unused includes of the kselftest.h header.Acked-by: Christian Brauner <christian.brauner@ubuntu.com>Signed-off-by: Kees Cook <keescook@chromium.org>Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
selftests: add pid namespace ENOMEM regression testWe recently regressed (cf. [1] and its corresponding fix in [2]) returningENOMEM when trying to create a process in a pid namespace whose initpr
selftests: add pid namespace ENOMEM regression testWe recently regressed (cf. [1] and its corresponding fix in [2]) returningENOMEM when trying to create a process in a pid namespace whose initprocess/child subreaper has already died. This has caused confusion atleast once before that (cf. [3]). Let's add a simple regression test tocatch this in the future.[1]: 49cb2fc42ce4 ("fork: extend clone3() to support setting a PID")[2]: b26ebfe12f34 ("pid: Fix error return value in some cases")[3]: 35f71bc0a09a ("fork: report pid reservation failure properly")Cc: Corey Minyard <cminyard@mvista.com>Cc: Oleg Nesterov <oleg@redhat.com>Cc: Adrian Reber <areber@redhat.com>Cc: Dmitry Safonov <0x7f454c46@gmail.com>Cc: Andrei Vagin <avagin@gmail.com>Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>