Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'threads-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux

Pull thread updates from Christian Brauner:
"The main change for this cycle was the extension for clone3() to
support spawning processes directly into cgroups via CLONE_INTO_CGROUP
(commit ef2c41cf38a7: "clone3: allow spawning processes
into cgroups").

But since I had to touch kernel/cgroup/ quite a bit I had Tejun route
that through his tree this time around to make it easier for him to
handle other changes.

So here is just the unexciting leftovers: a regression test for the
ENOMEM regression we fixed in commit b26ebfe12f34 ("pid: Fix error
return value in some cases") verifying that we report ENOMEM when
trying to create a new process in a pid namespace whose init
process/subreaper has already exited"

* tag 'threads-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
selftests: add pid namespace ENOMEM regression test

+60
+1
MAINTAINERS
··· 13285 13285 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git 13286 13286 F: samples/pidfd/ 13287 13287 F: tools/testing/selftests/pidfd/ 13288 + F: tools/testing/selftests/pid_namespace/ 13288 13289 F: tools/testing/selftests/clone3/ 13289 13290 K: (?i)pidfd 13290 13291 K: (?i)clone3
+1
tools/testing/selftests/Makefile
··· 38 38 TARGETS += netfilter 39 39 TARGETS += nsfs 40 40 TARGETS += pidfd 41 + TARGETS += pid_namespace 41 42 TARGETS += powerpc 42 43 TARGETS += proc 43 44 TARGETS += pstore
+1
tools/testing/selftests/pid_namespace/.gitignore
··· 1 + regression_enomem
+8
tools/testing/selftests/pid_namespace/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + CFLAGS += -g -I../../../../usr/include/ 3 + 4 + TEST_GEN_PROGS := regression_enomem 5 + 6 + include ../lib.mk 7 + 8 + $(OUTPUT)/regression_enomem: regression_enomem.c ../pidfd/pidfd.h
+2
tools/testing/selftests/pid_namespace/config
··· 1 + CONFIG_PID_NS=y 2 + CONFIG_USER_NS=y
+45
tools/testing/selftests/pid_namespace/regression_enomem.c
··· 1 + #define _GNU_SOURCE 2 + #include <assert.h> 3 + #include <errno.h> 4 + #include <fcntl.h> 5 + #include <linux/types.h> 6 + #include <sched.h> 7 + #include <signal.h> 8 + #include <stdio.h> 9 + #include <stdlib.h> 10 + #include <string.h> 11 + #include <syscall.h> 12 + #include <sys/wait.h> 13 + 14 + #include "../kselftest.h" 15 + #include "../kselftest_harness.h" 16 + #include "../pidfd/pidfd.h" 17 + 18 + /* 19 + * Regression test for: 20 + * 35f71bc0a09a ("fork: report pid reservation failure properly") 21 + * b26ebfe12f34 ("pid: Fix error return value in some cases") 22 + */ 23 + TEST(regression_enomem) 24 + { 25 + pid_t pid; 26 + 27 + if (geteuid()) 28 + EXPECT_EQ(0, unshare(CLONE_NEWUSER)); 29 + 30 + EXPECT_EQ(0, unshare(CLONE_NEWPID)); 31 + 32 + pid = fork(); 33 + ASSERT_GE(pid, 0); 34 + 35 + if (pid == 0) 36 + exit(EXIT_SUCCESS); 37 + 38 + EXPECT_EQ(0, wait_for_pid(pid)); 39 + 40 + pid = fork(); 41 + ASSERT_LT(pid, 0); 42 + ASSERT_EQ(errno, ENOMEM); 43 + } 44 + 45 + TEST_HARNESS_MAIN
+2
tools/testing/selftests/pidfd/pidfd.h
··· 13 13 #include <string.h> 14 14 #include <syscall.h> 15 15 #include <sys/mount.h> 16 + #include <sys/types.h> 17 + #include <sys/wait.h> 16 18 17 19 #include "../kselftest.h" 18 20