Re: [PATCH v14 10/12] selftests/landlock: Add network tests

2023-12-20 Thread Mickaël Salaün
t; > > > The "port_specific" fixture is extended with 4 variants defined > > as a matrix of: sandboxed/not-sandboxed, IPv4/IPv6 network domain, > > and stream socket. 2 related tests suites are defined: > > * bind_connect_zero: Tests with port 0 value. > >

Re: [PATCH] selftests/landlock:Fix two build issues

2024-01-10 Thread Mickaël Salaün
On Wed, Jan 10, 2024 at 03:08:54PM +0800, Hu Yadi wrote: > From: "Hu.Yadi" > > Two issues comes up while building selftest/landlock: > > the first one is as to gettid > > net_test.c: In function ‘set_service’: > net_test.c:91:45: warning: implicit declaration of function ‘gettid’; did you > m

Re: [PATCH v2] selftests/move_mount_set_group:Make tests build with old libc

2024-01-10 Thread Mickaël Salaün
On Wed, Jan 10, 2024 at 03:29:01PM +0800, Hu Yadi wrote: > From: "Hu.Yadi" > > Replace SYS_ with __NR_. Using the __NR_ > notation, provided by UAPI, is useful to build tests on systems without > the SYS_ definitions. This looks a lot like that... https://git.kernel.org/stable/c/87129ef13603ae4

Re: 回复: [PATCH v2] selftests/move_mount_set_group:Make tests build with old libc

2024-01-11 Thread Mickaël Salaün
could fix both changes. You can append this to the commit message (with the v2 description): Similar changes: commit 87129ef13603 ("selftests/landlock: Make tests build with old libc") Acked-by: Mickaël Salaün > > >> > >> Replace SYS_move_mount with __NR_move_mount &

Re: [PATCH v4] selftests/move_mount_set_group:Make tests build with old libc

2024-01-11 Thread Mickaël Salaün
nt > > Similar changes: commit 87129ef13603 ("selftests/landlock: Make tests build > with old libc") > > Acked-by: Mickaël Salaün Sorry, it should have been Reviewed-by: Mickaël Salaün Also, this is maintained by the VFS maintainers. I CCed three relevant ad

Re: 回复: [PATCH] selftests/landlock:Fix two build issues

2024-01-11 Thread Mickaël Salaün
On Thu, Jan 11, 2024 at 02:34:08AM +, Huyadi wrote: > > ->On Wed, Jan 10, 2024 at 03:08:54PM +0800, Hu Yadi wrote: > >> From: "Hu.Yadi" > >> > >> Two issues comes up while building selftest/landlock: > >> > >> the first one is as to gettid > >> > >> net_test.c: In function ‘set_service’:

Re: Re: [PATCH v14 10/12] selftests/landlock: Add network tests

2024-01-11 Thread Mickaël Salaün
/20/23 2:17 PM, Mickaël Salaün wrote: > > Hi Muhammad, > > > > Thanks for the report. > > > > On Tue, Dec 19, 2023 at 03:38:55PM +0500, Muhammad Usama Anjum wrote: > >> Hi Konstantin, > >> > >> There are some errors being report

Re: [PATCH v3] selftests/landlock:Fix two build issues

2024-01-12 Thread Mickaël Salaün
On Fri, Jan 12, 2024 at 03:12:45PM +0800, Hu Yadi wrote: > From: "Hu.Yadi" > > Two issues comes up while building selftest/landlock on my side > (gcc 7.3/glibc-2.28/kernel-4.19) > > the first one is as to gettid > > net_test.c: In function ‘set_service’: > net_test.c:91:45: warning: implicit de

[PATCH v1] landlock: Add support for KUnit tests

2024-01-18 Thread Mickaël Salaün
00:00] [00:00:00] Testing complete. Ran 7 tests: passed: 7 Cc: Günther Noack Cc: Konstantin Meskhidze Signed-off-by: Mickaël Salaün --- security/landlock/.kunitconfig | 4 + security/landlock/Kconfig| 15 ++ security/landlock/com

[PATCH] kunit: tool: Print UML command

2024-01-18 Thread Mickaël Salaün
As for the Qemu command, print the command used to run tests with UML. Cc: Brendan Higgins Cc: David Gow Signed-off-by: Mickaël Salaün --- tools/testing/kunit/kunit_kernel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit

Re: [PATCH v4] selftests/landlock:Fix two build issues

2024-01-19 Thread Mickaël Salaün
On Mon, Jan 15, 2024 at 06:24:09PM +0800, Hu Yadi wrote: > From: "Hu.Yadi" > > Two issues comes up while building selftest/landlock on my side > (gcc 7.3/glibc-2.28/kernel-4.19) > > the first one is as to gettid > > net_test.c: In function ‘set_service’: > net_test.c:91:45: warning: implicit de

Re: Re: [PATCH v1] landlock: Add support for KUnit tests

2024-01-23 Thread Mickaël Salaün
On Fri, Jan 19, 2024 at 01:25:06PM +0100, Günther Noack wrote: > Thank you, this is really nice! > > Only tiny style nitpicks here. > > Reviewed-by: G�nther Noack > > On Thu, Jan 18, 2024 at 12:36:32PM +0100, Micka�l Sala�n wrote: > > Add the SECURITY_LANDLOCK_KUNIT_TEST option to enable

Re: [PATCH] selftests/landlock:Fix net_test build issues with old libc

2024-01-23 Thread Mickaël Salaün
Thanks, I tweaked a bit and merged this patch in my next branch. On Tue, Jan 23, 2024 at 02:26:21PM +0800, Hu Yadi wrote: > From: "Hu.Yadi" There is an extra "." here, I fixed it. You don't need to add this From field if it matches your email's From one. > > Fixes: a549d055a22e ("selftests/lan

Re: 回复: [PATCH v4] selftests/landlock:Fix two build issues

2024-01-23 Thread Mickaël Salaün
On Tue, Jan 23, 2024 at 12:04:17PM +, Huyadi wrote: > > >> Changes v3 -> v2: > >> - add helper of gettid instead of __NR_gettid > >> - add gcc/glibc version info in comments Changes v1 -> v2: > >> - fix whitespace error > >> - replace SYS_gettid with _NR_gettid > >> > >> tools/testing/se

Re: [PATCH] selftests/landlock:Fix fs_test build issues with old libc

2024-01-24 Thread Mickaël Salaün
Thanks, it's merged with some fixes: https://git.kernel.org/mic/c/82852a3cc2152eb7c7b7007b6430faa979b08fad On Wed, Jan 24, 2024 at 10:29:08AM +0800, Hu Yadi wrote: > From: "Hu.Yadi" You might want to fix the extra dot in your name. > > Fixes: 04f9070e99a4 ("selftests/landlock: Add tests for ps

[PATCH v1 2/2] selftests/landlock: Clean up error logs related to capabilities

2024-01-25 Thread Mickaël Salaün
It doesn't help to call TH_LOG() for every cap_*() error. Let's only log errors returned by the kernel, not by libcap specificities. Signed-off-by: Mickaël Salaün --- tools/testing/selftests/landlock/common.h | 39 ++- 1 file changed, 9 insertions(+), 30 deletion

[PATCH v1 1/2] selftests/landlock: Fix capability for net_test

2024-01-25 Thread Mickaël Salaün
et_ambient_cap() and clear_ambient_cap() helpers. This makes it possible to run all Landlock tests (including net_test) with uml-run.sh from https://github.com/landlock-lsm/landlock-test-tools Cc: Konstantin Meskhidze Fixes: a549d055a22e ("selftests/landlock: Add network tests")

[PATCH v1 0/2] Fix Landlock's net_test for non-root users

2024-01-25 Thread Mickaël Salaün
Hi, This two patches fix an issue when the user running net_test is not root. The second patch simplify test error logs. Regards, Mickaël Salaün (2): selftests/landlock: Fix capability for net_test selftests/landlock: Clean up error logs related to capabilities tools/testing/selftests

[PATCH 0/2] Merge TEST_F_FORK() into TEST_F()

2024-02-26 Thread Mickaël Salaün
Hi, This is a long due cleanup to merge TEST_F_FORK() into TEST_F(). This should simplify Jakub's patches by removing the step counter: https://lore.kernel.org/r/20240220192235.2953484-1-k...@kernel.org Regards, Mickaël Salaün (2): selftests/landlock: Redefine TEST_F() as TEST_F

Re: [PATCH net-next v3 00/11] selftests: kselftest_harness: support using xfail

2024-02-26 Thread Mickaël Salaün
On Fri, Feb 23, 2024 at 04:02:59PM -0800, Jakub Kicinski wrote: > On Tue, 20 Feb 2024 11:22:24 -0800 Jakub Kicinski wrote: > > When running selftests for our subsystem in our CI we'd like all > > tests to pass. Currently some tests use SKIP for cases they > > expect to fail, because the kselftest_h

[PATCH 1/2] selftests/landlock: Redefine TEST_F() as TEST_F_FORK()

2024-02-26 Thread Mickaël Salaün
rewry Signed-off-by: Mickaël Salaün --- tools/testing/selftests/landlock/common.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h index 425c5698aea2..0bc15d36971a 100644 --- a/tools/te

[PATCH 2/2] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-02-26 Thread Mickaël Salaün
_harness.h to print which assert failed"). Replace spaces with tabs in one line of __TEST_F_IMPL(). Cc: Günther Noack Cc: Jakub Kicinski Cc: Kees Cook Cc: Shuah Khan Cc: Will Drewry Signed-off-by: Mickaël Salaün --- tools/testing/selftests/kselftest_harness.h | 56 +-

Re: [PATCH 2/2] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-02-26 Thread Mickaël Salaün
On Mon, Feb 26, 2024 at 11:04:12AM -0800, Kees Cook wrote: > On Mon, Feb 26, 2024 at 05:23:35PM +0100, Mickaël Salaün wrote: > > Remplace Landlock-specific TEST_F_FORK() with an improved TEST_F() which > > brings four related changes: > > > > Run TEST_F()'s tests

Re: [PATCH v4 02/12] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-03-04 Thread Mickaël Salaün
t help would be much appreciated! On Wed, Feb 28, 2024 at 04:59:09PM -0800, Jakub Kicinski wrote: > From: Mickaël Salaün > > Replace Landlock-specific TEST_F_FORK() with an improved TEST_F() which > brings four related changes: > > Run TEST_F()'s tests in a grandchild

Re: [PATCH v4 02/12] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-03-04 Thread Mickaël Salaün
On Mon, Mar 04, 2024 at 08:27:50PM +0100, Mickaël Salaün wrote: > Testing the whole series, I found that some Landlock tests are flaky > starting with this patch. I tried to not use the longjmp in the > grandchild but it didn't change. I suspect missing volatiles but I > didn&

Re: [PATCH v4 02/12] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-03-05 Thread Mickaël Salaün
r(variant->file_path, '/'); ASSERT_NE(slash, NULL); dir_len = (size_t)slash - (size_t)variant->file_path; On Mon, Mar 04, 2024 at 08:31:49PM +0100, Mickaël Salaün wrote: > On Mon, Mar 04, 2024 at 08:27:50PM +0100, Mickaël Salaün wrote: > > Testing the whole se

[PATCH v1 2/2] selftests/harness: Merge TEST_F_FORK() into TEST_F()

2024-03-05 Thread Mickaël Salaün
rint which assert failed"). Replace spaces with tabs in one line of __TEST_F_IMPL(). Cc: Günther Noack Cc: Shuah Khan Cc: Will Drewry Cc: Kees Cook Cc: Jakub Kicinski Signed-off-by: Mickaël Salaün --- v5: - Fix TEST_SIGNAL() by forwarding grandchild signal to parent. - By default,

[PATCH v1 0/2] Merge TEST_F_FORK() into TEST_F()

2024-03-05 Thread Mickaël Salaün
er and simplify Landlock's test teardowns by removing some umount calls. See https://lore.kernel.org/r/20240229005920.2407409-1-k...@kernel.org Regards, Mickaël Salaün (2): selftests/landlock: Redefine TEST_F() as TEST_F_FORK() selftests/harness: Merge TEST_F_FORK() into TEST_F() too

[PATCH v1 1/2] selftests/landlock: Redefine TEST_F() as TEST_F_FORK()

2024-03-05 Thread Mickaël Salaün
inski Signed-off-by: Mickaël Salaün --- tools/testing/selftests/landlock/common.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h index e64bbdf0e86e..f40146d40763 100644 --- a/tools/te

Re: [PATCH v4 00/12] selftests: kselftest_harness: support using xfail

2024-03-05 Thread Mickaël Salaün
On Tue, Mar 05, 2024 at 01:43:14AM -0800, Kees Cook wrote: > On Mon, Mar 04, 2024 at 03:39:02PM -0800, Jakub Kicinski wrote: > > On Mon, 4 Mar 2024 15:14:04 -0800 Kees Cook wrote: > > > > Ugh, I'm guessing vfork() "eats" the signal, IOW grandchild signals, > > > > child exits? vfork() and signals..

Re: [PATCH v4 00/12] selftests: kselftest_harness: support using xfail

2024-03-05 Thread Mickaël Salaün
On Tue, Mar 05, 2024 at 04:48:06PM +0100, Przemek Kitszel wrote: > On 3/5/24 00:04, Jakub Kicinski wrote: > > On Mon, 4 Mar 2024 22:20:03 + Mark Brown wrote: > > > On Wed, Feb 28, 2024 at 04:59:07PM -0800, Jakub Kicinski wrote: > > > > > > > When running selftests for our subsystem in our CI w

Re: [PATCH v4 00/12] selftests: kselftest_harness: support using xfail

2024-03-05 Thread Mickaël Salaün
On Tue, Mar 05, 2024 at 05:00:13PM +0100, Mickaël Salaün wrote: > On Tue, Mar 05, 2024 at 04:48:06PM +0100, Przemek Kitszel wrote: > > On 3/5/24 00:04, Jakub Kicinski wrote: > > > On Mon, 4 Mar 2024 22:20:03 + Mark Brown wrote: > > > > On Wed, Feb 28, 2024 at 04

Re: [PATCH v4 00/12] selftests: kselftest_harness: support using xfail

2024-03-05 Thread Mickaël Salaün
On Tue, Mar 05, 2024 at 10:06:39AM -0800, Jakub Kicinski wrote: > On Tue, 5 Mar 2024 17:05:51 +0100 Mickaël Salaün wrote: > > > I think we have to -- other CIs are now showing the most of seccomp > > > failing now. (And I can confirm this now -- I had only tested seccomp >

[PATCH] selftests/harness: Fix TEST_F()'s vfork handling

2024-03-05 Thread Mickaël Salaün
Always run fixture setup in the grandchild process, and by default also run the teardown in the same process. However, this change makes it possible to run the teardown in a parent process when _metadata->teardown_parent is set to true (e.g. in fixture setup). Fix TEST_SIGNAL() by forwarding gran

Re: [PATCH] selftests/harness: Fix TEST_F()'s vfork handling

2024-03-05 Thread Mickaël Salaün
On Tue, Mar 05, 2024 at 12:25:54PM -0800, Jakub Kicinski wrote: > On Tue, 5 Mar 2024 21:10:29 +0100 Mickaël Salaün wrote: > > Always run fixture setup in the grandchild process, and by default also > > run the teardown in the same process. However, this change makes it > >

Re: [PATCH] selftests/harness: Fix TEST_F()'s vfork handling

2024-03-05 Thread Mickaël Salaün
On Wed, Mar 06, 2024 at 08:25:45AM +0100, Mickaël Salaün wrote: > On Tue, Mar 05, 2024 at 12:25:54PM -0800, Jakub Kicinski wrote: > > On Tue, 5 Mar 2024 21:10:29 +0100 Mickaël Salaün wrote: > > > Always run fixture setup in the grandchild process, and by default also > > &

Re: Subject: [PATCH] Add test for more file systems in landlock - ext4

2024-04-03 Thread Mickaël Salaün
On Tue, Apr 02, 2024 at 01:37:44PM +0530, Saasha Gupta wrote: > Date: Mon, 2 Apr 2024 19:59:56 +0530 > > RE: This patch is now properly preformatted. > > Landlock LSM, a part of the security subsystem, has some tests in place > for synthetic filesystems such as tmpfs, proc, sysfs, etc. The goal o

[PATCH v4 RESEND 0/7] Handle faults in KUnit tests

2024-04-08 Thread Mickaël Salaün
org/r/20240229170409.365386-1-...@digikod.net Regards, Mickaël Salaün (7): kunit: Handle thread creation error kunit: Fix kthread reference kunit: Fix timeout message kunit: Handle test faults kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests kunit: Print last test location on fault kunit

[PATCH v4 RESEND 2/7] kunit: Fix kthread reference

2024-04-08 Thread Mickaël Salaün
eviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-3-...@digikod.net --- Changes since v2: * Add Fixes tag as suggested by David. * Add David's and Rae's Reviewed-by. Changes since v1: * Add Kees's Review

[PATCH v4 RESEND 1/7] kunit: Handle thread creation error

2024-04-08 Thread Mickaël Salaün
ernal error occurred...". Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-2-...@digikod.net --- Changes since v2: * Add Rae's and David's R

[PATCH v4 RESEND 3/7] kunit: Fix timeout message

2024-04-08 Thread Mickaël Salaün
The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-4-...@digiko

[PATCH v4 RESEND 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

2024-04-08 Thread Mickaël Salaün
Fix KUNIT_SUCCESS() calls to pass a test argument. This is a no-op for now because this macro does nothing, but it will be required for the next commit. Cc: Brendan Higgins Cc: Rae Moar Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Mickaël Salaün Link: https

[PATCH v4 RESEND 4/7] kunit: Handle test faults

2024-04-08 Thread Mickaël Salaün
by: David Gow Tested-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-5-...@digikod.net --- Changes since v3: * Export kthread_exit() for KUnit tests built as module, as suggested by David. Changes since v2: * s/-EFAULT/-EINTR/ in commit message as s

[PATCH v4 RESEND 6/7] kunit: Print last test location on fault

2024-04-08 Thread Mickaël Salaün
Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-7-...@digikod.net --- Changes since v3: * Improve the try-fault error message as suggested by David. Changes since v2: * Extend the commit message according to discussion with David. Changes

[PATCH v4 RESEND 7/7] kunit: Add tests for fault

2024-04-08 Thread Mickaël Salaün
/testing/kunit/kunit.py run --arch arm64 \ --cross_compile=aarch64-linux-gnu- kunit_fault Cc: Brendan Higgins Cc: Rae Moar Cc: Shuah Khan Reviewed-by: David Gow Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240408074625.65017-8-...@digikod.net --- Changes since v2: * Add

[PATCH v1] selftests/harness: Fix tests timeout and race condition

2024-06-21 Thread Mickaël Salaün
4db-5e21-418c-bf9e-9ae2da787...@sirena.org.uk Fixes: a86f18903db9 ("selftests/harness: Fix interleaved scheduling leading to race conditions") Fixes: 24cf65a62266 ("selftests/harness: Share _metadata between forked processes") Signed-off-by: Mickaël Salaün Link: https://lore.kern

Re: [PATCH v1] selftests/harness: Fix tests timeout and race condition

2024-06-25 Thread Mickaël Salaün
I pushed it to my next branch. Mark, Shuah, and others, please let me know if kselftest and KernelCI are better with that. On Fri, Jun 21, 2024 at 08:06:05PM +0200, Mickaël Salaün wrote: > We cannot use CLONE_VFORK because we also need to wait for the timeout > signal. > > Restore t

[GIT PULL] Kselftest fixes for v6.10

2024-07-04 Thread Mickaël Salaün
:03 +0200) Fix Kselftests timeout and race condition -------- Mickaël Salaün (1): selftests/harness: Fix tests timeout and race condition tools/testing/selftests/kselftest_harn

Re: [PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread Mickaël Salaün
imply adapt those > conditions, and add a dependency on !UML for our new option. > > Suggested-by: Guenter Roeck > Link: > https://lore.kernel.org/all/928249cc-e027-4f7f-b43f-502f99a1e...@roeck-us.net/ > Fixes: 82b0beff3497 ("kunit: Add tests for fault") > Signed-off-by: David

Re: [linus:master] [selftests/harness] 0710a1a73f: kernel-selftests.pidfd.pidfd_setns_test.fail

2024-04-25 Thread Mickaël Salaün
FYI, I'm working on this issue. Regards, Mickaël On Fri, Mar 29, 2024 at 10:42:51AM +0800, kernel test robot wrote: > > > Hello, > > kernel test robot noticed "kernel-selftests.pidfd.pidfd_setns_test.fail" on: > > commit: 0710a1a73fb45033ebb06073e374ab7d44a05f15 ("selftests/harness: Merge >

[PATCH v1 2/5] selftests/landlock: Fix FS tests when run on a private mount point

2024-04-26 Thread Mickaël Salaün
rent Linux distributions, with different mount point configurations. Cc: Günther Noack Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240426172252.1862930-3-...@digikod.net --- tools/testing/se

[PATCH v1 4/5] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-04-26 Thread Mickaël Salaün
: Mark Brown Cc: Shuah Khan Cc: Will Drewry Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240426172252.1862930-5-...@digikod.net --- tools/testing/selftests/kselftest_harness.h | 15

[PATCH v1 3/5] selftests/harness: Fix fixture teardown

2024-04-26 Thread Mickaël Salaün
/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN") Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240426172252.1862930-4-...@digikod.net --- tools/testing/selftests/k

[PATCH v1 1/5] selftests/pidfd: Fix config for pidfd_setns_test

2024-04-26 Thread Mickaël Salaün
tests") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240426172252.1862930-2-...@digikod.net --- tools/testing/selftests/pidfd/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/pidfd/config b/tools/testing/selftests/pidfd/config index f6

[PATCH v1 5/5] selftests/harness: Fix vfork() side effects and uncaught errors

2024-04-26 Thread Mickaël Salaün
b4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240426172252.1862930-6-...@digikod.net --- tools/testing/selftests/kselftest_harness.h | 88 +-- tools/testing/selftests/landlock/fs_test.c|

[PATCH v1 0/5] Fix Kselftest's vfork() side effects

2024-04-26 Thread Mickaël Salaün
_test - pidfd:pidfd_setns_test - seccomp:seccomp_bpf - user_events:abi_test [1] https://lore.kernel.org/oe-lkp/202403291015.1fcfa957-oliver.s...@intel.com Regards, Mickaël Salaün (5): selftests/pidfd: Fix config for pidfd_setns_test selftests/landlock: Fix FS tests when run on a private mount point self

Re: [PATCH v1 5/5] selftests/harness: Fix vfork() side effects and uncaught errors

2024-04-29 Thread Mickaël Salaün
On Fri, Apr 26, 2024 at 12:47:16PM -0700, Kees Cook wrote: > On Fri, Apr 26, 2024 at 07:22:52PM +0200, Mickaël Salaün wrote: > > Setting the time namespace with CLONE_NEWTIME returns -EUSERS if the > > calling thread shares memory with another thread (because of the shared > >

Re: [PATCH v1 2/5] selftests/landlock: Fix FS tests when run on a private mount point

2024-04-29 Thread Mickaël Salaün
On Fri, Apr 26, 2024 at 12:38:17PM -0700, Kees Cook wrote: > On Fri, Apr 26, 2024 at 07:22:49PM +0200, Mickaël Salaün wrote: > > According to the test environment, the mount point of the test's working > > directory may be shared or not, which changes the visibility of the &g

[PATCH v2 0/5] Fix Kselftest's vfork() side effects

2024-04-29 Thread Mickaël Salaün
pidfd - perf_events:remove_on_exec - pidfd:pidfd_getfd_test - pidfd:pidfd_setns_test - seccomp:seccomp_bpf - user_events:abi_test [1] https://lore.kernel.org/oe-lkp/202403291015.1fcfa957-oliver.s...@intel.com Previous version: v1: https://lore.kernel.org/r/20240426172252.1862930-1-...@digikod.net Regards, Mi

[PATCH v2 2/9] selftests/landlock: Fix FS tests when run on a private mount point

2024-04-29 Thread Mickaël Salaün
rs [1], where mount points are private. Cc: Günther Noack Cc: Shuah Khan Link: https://github.com/landlock-lsm/landlock-test-tools/pull/4 [1] Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https

[PATCH v2 3/9] selftests/harness: Fix fixture teardown

2024-04-29 Thread Mickaël Salaün
90b ("selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN") Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394118-4-...

[PATCH v2 8/9] selftests/harness: Share _metadata between forked processes

2024-04-29 Thread Mickaël Salaün
_metadata to extend expectations to test process's forks. For instance, this change identified a wrong expectation in pidfd_setns_test. Cc: Jakub Kicinski Cc: Kees Cook Cc: Shuah Khan Cc: Will Drewry Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394

[PATCH v2 5/9] selftests/landlock: Do not allocate memory in fixture data

2024-04-29 Thread Mickaël Salaün
her Noack Cc: Kees Cook Cc: Shuah Khan Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394118-6-...@digikod.net --- Changes since v1: * Extract change from a bigger patch (suggested by Kees). --- tools/testing/selftests/landlock/fs_test.c | 57 +-

[PATCH v2 7/9] selftests/pidfd: Fix wrong expectation

2024-04-29 Thread Mickaël Salaün
Replace a wrong EXPECT_GT(self->child_pid_exited, 0) with EXPECT_GE(), which will be actually tested on the parent and child sides with a following commit. Cc: Christian Brauner Cc: Kees Cook Cc: Shuah Khan Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.239411

[PATCH v2 4/9] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-04-29 Thread Mickaël Salaün
: Mark Brown Cc: Shuah Khan Cc: Will Drewry Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394118-5-...@digikod.net --- tools/testing/selftests/kselftest_harness.h | 15

[PATCH v2 6/9] selftests/harness: Constify fixture variants

2024-04-29 Thread Mickaël Salaün
FIXTURE_VARIANT_ADD() types are passed as const pointers to FIXTURE_TEARDOWN(). Make that explicit by constifying the variants declarations. Cc: Kees Cook Cc: Shuah Khan Cc: Will Drewry Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394118-7-...@digikod.net

[PATCH v2 9/9] selftests/harness: Fix vfork() side effects

2024-04-29 Thread Mickaël Salaün
Cc: Kees Cook Cc: Mark Brown Cc: Shuah Khan Cc: Will Drewry Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403291015.1fcfa957-oliver.s...@intel.com Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Signed-off-by: Mick

[PATCH v2 1/9] selftests/pidfd: Fix config for pidfd_setns_test

2024-04-29 Thread Mickaël Salaün
tests") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429130931.2394118-2-...@digikod.net --- tools/testing/selftests/pidfd/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/pidfd/config b/tools/testing/selftests/pi

Re: [PATCH v2 4/9] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-04-29 Thread Mickaël Salaün
On Mon, Apr 29, 2024 at 10:16:47AM -0700, Jakub Kicinski wrote: > On Mon, 29 Apr 2024 08:52:36 -0700 Kees Cook wrote: > > > +/* Wait for the child process to end but without sharing memory mapping. > > > */ > > > +static pid_t __attribute__((__unused__)) clone3_vfork(void) > > > > Why "unused"?

[PATCH v3 0/9] Fix Kselftest's vfork() side effects

2024-04-29 Thread Mickaël Salaün
930-1-...@digikod.net v2: https://lore.kernel.org/r/20240429130931.2394118-1-...@digikod.net Regards, Mickaël Salaün (9): selftests/pidfd: Fix config for pidfd_setns_test selftests/landlock: Fix FS tests when run on a private mount point selftests/harness: Fix fixture teardown selftests/harness

[PATCH v3 4/9] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-04-29 Thread Mickaël Salaün
: Shuah Khan Cc: Will Drewry Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552580-5-...@digikod.net --- Changes since v2: * Replace __attribute__((__unused_

[PATCH v3 1/9] selftests/pidfd: Fix config for pidfd_setns_test

2024-04-29 Thread Mickaël Salaün
tests") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552580-2-...@digikod.net --- tools/testing/selftests/pidfd/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/pidfd/config b/tools/testing/selftests/pi

[PATCH v3 6/9] selftests/harness: Constify fixture variants

2024-04-29 Thread Mickaël Salaün
FIXTURE_VARIANT_ADD() types are passed as const pointers to FIXTURE_TEARDOWN(). Make that explicit by constifying the variants declarations. Cc: Shuah Khan Cc: Will Drewry Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552580-7

[PATCH v3 7/9] selftests/pidfd: Fix wrong expectation

2024-04-29 Thread Mickaël Salaün
Replace a wrong EXPECT_GT(self->child_pid_exited, 0) with EXPECT_GE(), which will be actually tested on the parent and child sides with a following commit. Cc: Christian Brauner Cc: Shuah Khan Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.or

[PATCH v3 8/9] selftests/harness: Share _metadata between forked processes

2024-04-29 Thread Mickaël Salaün
_metadata to extend expectations to test process's forks. For instance, this change identified a wrong expectation in pidfd_setns_test. Cc: Jakub Kicinski Cc: Shuah Khan Cc: Will Drewry Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552

[PATCH v3 3/9] selftests/harness: Fix fixture teardown

2024-04-29 Thread Mickaël Salaün
90b ("selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN") Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552580-4-...

[PATCH v3 9/9] selftests/harness: Fix vfork() side effects

2024-04-29 Thread Mickaël Salaün
c: Mark Brown Cc: Shuah Khan Cc: Will Drewry Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403291015.1fcfa957-oliver.s...@intel.com Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Reviewed-by: Kees Cook Signed-off-by: Mick

[PATCH v3 5/9] selftests/landlock: Do not allocate memory in fixture data

2024-04-29 Thread Mickaël Salaün
her Noack Cc: Shuah Khan Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240429191911.2552580-6-...@digikod.net --- Changes since v1: * Extract change from a bigger patch (suggested by Kees). --- tools/testing/selftests/landlock/fs_test.c |

[PATCH v3 2/9] selftests/landlock: Fix FS tests when run on a private mount point

2024-04-29 Thread Mickaël Salaün
rs [1], where mount points are private. Cc: Günther Noack Cc: Shuah Khan Link: https://github.com/landlock-lsm/landlock-test-tools/pull/4 [1] Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https

Re: [PATCH v3 0/9] Fix Kselftest's vfork() side effects

2024-04-30 Thread Mickaël Salaün
, 2024 at 09:19:02PM +0200, Mickaël Salaün wrote: > Hi, > > As reported by Kernel Test Robot [1], some pidfd tests fail. This is > due to the use of vfork() which introduced some side effects. > Similarly, while making it more generic, a previous commit made some > Landlock file

Re: [PATCH v3 0/9] Fix Kselftest's vfork() side effects

2024-04-30 Thread Mickaël Salaün
On Tue, Apr 30, 2024 at 08:13:04AM -0700, Jakub Kicinski wrote: > On Tue, 30 Apr 2024 15:54:38 +0200 Mickaël Salaün wrote: > > Jakub, can you please review it? > > I looked thru it. I don't have the cycles to investigate and suggest > a better approach but the sprinkling

Re: [PATCH v4 00/12] selftests: kselftest_harness: support using xfail

2024-05-02 Thread Mickaël Salaün
On Thu, May 02, 2024 at 11:42:29AM GMT, Sean Christopherson wrote: > +kvm > > On Tue, Mar 05, 2024, Mickaël Salaün wrote: > > On Tue, Mar 05, 2024 at 01:43:14AM -0800, Kees Cook wrote: > > > On Mon, Mar 04, 2024 at 03:39:02PM -0800, Jakub Kicinski wrote: > > > &g

[PATCH v4 00/10] Fix Kselftest's vfork() side effects

2024-05-02 Thread Mickaël Salaün
930-1-...@digikod.net v2: https://lore.kernel.org/r/20240429130931.2394118-1-...@digikod.net v3: https://lore.kernel.org/r/20240429191911.2552580-1-...@digikod.net Regards, Mickaël Salaün (10): selftests/pidfd: Fix config for pidfd_setns_test selftests/landlock: Fix FS tests when run on a private mount

[PATCH v4 04/10] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-05-02 Thread Mickaël Salaün
: Shuah Khan Cc: Will Drewry Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-5-...@digikod.net --- Changes since v2: * Replace __attribute__((__unused_

[PATCH v4 02/10] selftests/landlock: Fix FS tests when run on a private mount point

2024-05-02 Thread Mickaël Salaün
rs [1], where mount points are private. Cc: Günther Noack Cc: Shuah Khan Link: https://github.com/landlock-lsm/landlock-test-tools/pull/4 [1] Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: http

[PATCH v4 03/10] selftests/harness: Fix fixture teardown

2024-05-02 Thread Mickaël Salaün
90b ("selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN") Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-4-...@digikod

[PATCH v4 06/10] selftests/harness: Constify fixture variants

2024-05-02 Thread Mickaël Salaün
FIXTURE_VARIANT_ADD() types are passed as const pointers to FIXTURE_TEARDOWN(). Make that explicit by constifying the variants declarations. Cc: Shuah Khan Cc: Will Drewry Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-7

[PATCH v4 07/10] selftests/pidfd: Fix wrong expectation

2024-05-02 Thread Mickaël Salaün
Replace a wrong EXPECT_GT(self->child_pid_exited, 0) with EXPECT_GE(), which will be actually tested on the parent and child sides with a following commit. Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: Christian Brauner Signed-off-by: Mickaël Salaün Link: https://lore.kernel.or

[PATCH v4 05/10] selftests/landlock: Do not allocate memory in fixture data

2024-05-02 Thread Mickaël Salaün
her Noack Cc: Shuah Khan Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-6-...@digikod.net --- Changes since v1: * Extract change from a bigger patch (suggested by Kees). --- tools/testing/selftests/landlock/fs_test.c |

[PATCH v4 08/10] selftests/harness: Share _metadata between forked processes

2024-05-02 Thread Mickaël Salaün
_metadata to extend expectations to test process's forks. For instance, this change identified a wrong expectation in pidfd_setns_test. Cc: Jakub Kicinski Cc: Shuah Khan Cc: Will Drewry Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145

[PATCH v4 09/10] selftests/harness: Fix vfork() side effects

2024-05-02 Thread Mickaël Salaün
c: Mark Brown Cc: Shuah Khan Cc: Will Drewry Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202403291015.1fcfa957-oliver.s...@intel.com Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Reviewed-by: Kees Cook Signed-off-by: Mick

[PATCH v4 10/10] selftests/harness: Fix TEST_F()'s exit codes

2024-05-02 Thread Mickaël Salaün
abtyv...@google.com [1] Fixes: 0710a1a73fb4 ("selftests/harness: Merge TEST_F_FORK() into TEST_F()") Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-11-...@digikod.net --- Changes since v3: * New patch mainly from Sean Christopherson. --- tools/te

[PATCH v4 01/10] selftests/pidfd: Fix config for pidfd_setns_test

2024-05-02 Thread Mickaël Salaün
Kees Cook Reviewed-by: Christian Brauner Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240502210926.145539-2-...@digikod.net --- tools/testing/selftests/pidfd/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/pidfd/config b/tools/testing/selft

Re: [PATCH v4 10/10] selftests/harness: Fix TEST_F()'s exit codes

2024-05-03 Thread Mickaël Salaün
On Thu, May 02, 2024 at 03:45:22PM GMT, Sean Christopherson wrote: > On Thu, May 02, 2024, Mickaël Salaün wrote: > > @@ -462,8 +462,10 @@ static inline pid_t clone3_vfork(void) > > munmap(teardown, sizeof(*teardown)); \ > > if (self && f

[PATCH v5 00/10] Fix Kselftest's vfork() side effects

2024-05-03 Thread Mickaël Salaün
580-1-...@digikod.net v4: https://lore.kernel.org/r/20240502210926.145539-1-...@digikod.net Regards, Mickaël Salaün (10): selftests/pidfd: Fix config for pidfd_setns_test selftests/landlock: Fix FS tests when run on a private mount point selftests/harness: Fix fixture teardown selftests/harness

[PATCH v5 04/10] selftests/harness: Fix interleaved scheduling leading to race conditions

2024-05-03 Thread Mickaël Salaün
: Shuah Khan Cc: Will Drewry Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240503105820.300927-5-...@digikod.net --- Changes since v2: * Replace __attribute__((__unused_

[PATCH v5 05/10] selftests/landlock: Do not allocate memory in fixture data

2024-05-03 Thread Mickaël Salaün
her Noack Cc: Shuah Khan Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240503105820.300927-6-...@digikod.net --- Changes since v1: * Extract change from a bigger patch (suggested by Kees). --- tools/testing/selftests/landlock/fs_test.c |

[PATCH v5 01/10] selftests/pidfd: Fix config for pidfd_setns_test

2024-05-03 Thread Mickaël Salaün
Kees Cook Reviewed-by: Christian Brauner Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240503105820.300927-2-...@digikod.net --- tools/testing/selftests/pidfd/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/pidfd/config b/tools/testing/selft

[PATCH v5 06/10] selftests/harness: Constify fixture variants

2024-05-03 Thread Mickaël Salaün
FIXTURE_VARIANT_ADD() types are passed as const pointers to FIXTURE_TEARDOWN(). Make that explicit by constifying the variants declarations. Cc: Shuah Khan Cc: Will Drewry Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240503105820.300927-7

[PATCH v5 02/10] selftests/landlock: Fix FS tests when run on a private mount point

2024-05-03 Thread Mickaël Salaün
rs [1], where mount points are private. Cc: Günther Noack Cc: Shuah Khan Link: https://github.com/landlock-lsm/landlock-test-tools/pull/4 [1] Fixes: 41cca0542d7c ("selftests/harness: Fix TEST_F()'s vfork handling") Reviewed-by: Kees Cook Signed-off-by: Mickaël Salaün Link: http

  1   2   >