| 2509bdc8 | 07-Apr-2026 |
Ricardo B. Marlière <rbm@suse.com> |
selftests/namespaces: Skip efault tests when listns() is not available
When listns() is not implemented the iterator child detects ENOSYS and exits cleanly with status PIDFD_SKIP before the parent h
selftests/namespaces: Skip efault tests when listns() is not available
When listns() is not implemented the iterator child detects ENOSYS and exits cleanly with status PIDFD_SKIP before the parent has a chance to signal it. The parent sends SIGKILL (which is a harmless no-op at that point) and then calls waitpid(), obtaining a normal-exit status. The subsequent ASSERT_TRUE(WIFSIGNALED(status)) therefore fails, causing the three EFAULT-focused tests to report FAIL rather than SKIP on kernels that do not yet carry listns() support.
After collecting the iterator's exit status, check whether it exited with PIDFD_SKIP and issue a SKIP verdict in that case, consistent with the behaviour of every other listns test that already handles ENOSYS correctly.
Signed-off-by: Ricardo B. Marlière <rbm@suse.com> Link: https://patch.msgid.link/20260407-selftests-namespaces_fixes-v1-3-59109909d88b@suse.com Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| f36ddf93 | 07-Apr-2026 |
Ricardo B. Marlière <rbm@suse.com> |
selftests/namespaces: Fix waitpid race in listns_efault_test cleanup
The efault tests spawn two categories of child processes: namespace children (each in its own mount namespace, for concurrent des
selftests/namespaces: Fix waitpid race in listns_efault_test cleanup
The efault tests spawn two categories of child processes: namespace children (each in its own mount namespace, for concurrent destruction) and an iterator child that calls listns() in a tight loop. The cleanup loop used waitpid(-1), which reaps any child in any order. If the iterator child exits early (e.g. because listns() returned ENOSYS) before all namespace children have been reaped, waitpid(-1) may consume it instead. The subsequent targeted waitpid(iter_pid) would then block indefinitely.
Track the PIDs of the namespace children explicitly and use targeted waitpid() calls in the cleanup loop so the iterator child cannot be inadvertently reaped during namespace cleanup.
Signed-off-by: Ricardo B. Marlière <rbm@suse.com> Link: https://patch.msgid.link/20260407-selftests-namespaces_fixes-v1-2-59109909d88b@suse.com Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 07d7ad46 | 09-Nov-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: test for efault
Ensure that put_user() can fail and that namespace cleanup works correctly.
Link: https://patch.msgid.link/20251109-namespace-6-19-fixes-v1-8-ae8a4ad5a3b3@kern
selftests/namespaces: test for efault
Ensure that put_user() can fail and that namespace cleanup works correctly.
Link: https://patch.msgid.link/20251109-namespace-6-19-fixes-v1-8-ae8a4ad5a3b3@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 2cc1c01f | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: test listns() pagination
Minimal test case to reproduce KASAN out-of-bounds in listns pagination.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-72-2e6
selftests/namespace: test listns() pagination
Minimal test case to reproduce KASAN out-of-bounds in listns pagination.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-72-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| fc858856 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: add stress test
Stress tests for namespace active reference counting.
These tests validate that the active reference counting system can handle high load scenarios including ra
selftests/namespace: add stress test
Stress tests for namespace active reference counting.
These tests validate that the active reference counting system can handle high load scenarios including rapid namespace creation/destruction, large numbers of concurrent namespaces, and various edge cases under stress.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-71-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| d18cf3f9 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: commit_creds() active reference tests
Test credential changes and their impact on namespace active references.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-lis
selftests/namespace: commit_creds() active reference tests
Test credential changes and their impact on namespace active references.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-70-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 80fedf81 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: third threaded active reference count test
Test that namespaces become inactive after subprocess with multiple threads exits. Create a subprocess that unshares user and network
selftests/namespace: third threaded active reference count test
Test that namespaces become inactive after subprocess with multiple threads exits. Create a subprocess that unshares user and network namespaces, then creates two threads that share those namespaces. Verify that after all threads and subprocess exit, the namespaces are no longer listed by listns() and cannot be opened by open_by_handle_at().
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-69-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| ee861032 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: second threaded active reference count test
Test that a namespace remains active while a thread holds an fd to it. Even after the thread exits, the namespace should remain activ
selftests/namespace: second threaded active reference count test
Test that a namespace remains active while a thread holds an fd to it. Even after the thread exits, the namespace should remain active as long as another thread holds a file descriptor to it.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-68-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 29f083c4 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespace: first threaded active reference count test
Test that namespace becomes inactive after thread exits. This verifies active reference counting works with threads, not just processe
selftests/namespace: first threaded active reference count test
Test that namespace becomes inactive after thread exits. This verifies active reference counting works with threads, not just processes.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-67-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| c89d100f | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: twelth inactive namespace resurrection test
Test multi-level namespace resurrection across three user namespace levels.
This test creates a complex namespace hierarchy with th
selftests/namespaces: twelth inactive namespace resurrection test
Test multi-level namespace resurrection across three user namespace levels.
This test creates a complex namespace hierarchy with three levels of user namespaces and a network namespace at the deepest level. It verifies that the resurrection semantics work correctly when SIOCGSKNS is called on a socket from an inactive namespace tree, and that listns() and open_by_handle_at() correctly respect visibility rules.
Hierarchy after child processes exit (all with 0 active refcount):
net_L3A (0) <- Level 3 network namespace | + userns_L3 (0) <- Level 3 user namespace | + userns_L2 (0) <- Level 2 user namespace | + userns_L1 (0) <- Level 1 user namespace | x init_user_ns
The test verifies: 1. SIOCGSKNS on a socket from inactive net_L3A resurrects the entire chain 2. After resurrection, all namespaces are visible in listns() 3. Resurrected namespaces can be reopened via file handles 4. Closing the netns FD cascades down: the entire ownership chain (userns_L3 -> userns_L2 -> userns_L1) becomes inactive again 5. Inactive namespaces disappear from listns() and cannot be reopened 6. Calling SIOCGSKNS again on the same socket resurrects the tree again 7. After second resurrection, namespaces are visible and can be reopened
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-66-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| c80168b6 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: eleventh inactive namespace resurrection test
Test combined listns() and file handle operations with socket-kept netns. Create a netns, keep it alive with a socket, verify it a
selftests/namespaces: eleventh inactive namespace resurrection test
Test combined listns() and file handle operations with socket-kept netns. Create a netns, keep it alive with a socket, verify it appears in listns(), then reopen it via file handle obtained from listns() entry.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-65-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 3798991a | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: tenth inactive namespace resurrection test
Test that socket-kept netns can be reopened via file handle. Verify that a network namespace kept alive by a socket FD can be reopene
selftests/namespaces: tenth inactive namespace resurrection test
Test that socket-kept netns can be reopened via file handle. Verify that a network namespace kept alive by a socket FD can be reopened using file handles even after the creating process exits.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-64-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| b9d09f56 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: ninth inactive namespace resurrection test
Test that socket-kept netns appears in listns() output. Verify that a network namespace kept alive by a socket FD appears in listns()
selftests/namespaces: ninth inactive namespace resurrection test
Test that socket-kept netns appears in listns() output. Verify that a network namespace kept alive by a socket FD appears in listns() output even after the creating process exits, and that it disappears when the socket is closed.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-63-2e6f823ebdc0@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 6de17ec3 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: eigth inactive namespace resurrection test
Test IPv6 sockets also work with SIOCGSKNS.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-62-2e6f823ebdc0@
selftests/namespaces: eigth inactive namespace resurrection test
Test IPv6 sockets also work with SIOCGSKNS.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-62-2e6f823ebdc0@kernel.org Tested-by: syzbot@syzkaller.appspotmail.com Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 54a29d12 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: seventh inactive namespace resurrection test
Test socket keeps netns active after creating process exits. Verify that as long as the socket FD exists, the namespace remains act
selftests/namespaces: seventh inactive namespace resurrection test
Test socket keeps netns active after creating process exits. Verify that as long as the socket FD exists, the namespace remains active.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-61-2e6f823ebdc0@kernel.org Tested-by: syzbot@syzkaller.appspotmail.com Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| aec22376 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: sixth inactive namespace resurrection test
Test multiple sockets keep the same network namespace active. Create multiple sockets, verify closing some doesn't affect others.
Li
selftests/namespaces: sixth inactive namespace resurrection test
Test multiple sockets keep the same network namespace active. Create multiple sockets, verify closing some doesn't affect others.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-60-2e6f823ebdc0@kernel.org Tested-by: syzbot@syzkaller.appspotmail.com Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 2b9fa5bf | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: fifth inactive namespace resurrection test
Test SIOCGSKNS fails on non-socket file descriptors.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-59-2e6f
selftests/namespaces: fifth inactive namespace resurrection test
Test SIOCGSKNS fails on non-socket file descriptors.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-59-2e6f823ebdc0@kernel.org Tested-by: syzbot@syzkaller.appspotmail.com Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|
| 40226da4 | 29-Oct-2025 |
Christian Brauner <brauner@kernel.org> |
selftests/namespaces: fourth inactive namespace resurrection test
Test SIOCGSKNS across setns. Create a socket in netns A, switch to netns B, verify SIOCGSKNS still returns netns A.
Link: https://p
selftests/namespaces: fourth inactive namespace resurrection test
Test SIOCGSKNS across setns. Create a socket in netns A, switch to netns B, verify SIOCGSKNS still returns netns A.
Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-58-2e6f823ebdc0@kernel.org Tested-by: syzbot@syzkaller.appspotmail.com Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
show more ...
|