[GIT PULL] clone3 fix for v6.3

From: Christian Brauner
Date: Sun Mar 12 2023 - 06:43:58 EST


Hey Linus,

/* Summary */
This contains a simple fix for the clone3() system call. The
CLONE_NEWTIME allows the creation of time namespaces. The flag reuses a
bit from the CSIGNAL bits that are used in the legacy clone() system
call to set the signal that gets sent to the parent after the child
exits.

The clone3() system call doesn't rely on CSIGNAL anymore as it uses a
dedicated .exit_signal field in struct clone_args. So we blocked all
CSIGNAL bits in clone3_args_valid(). When CLONE_NEWTIME was introduced
and reused a CSIGNAL bit we forgot to adapt clone3_args_valid() causing
CLONE_NEWTIME with clone3() to be rejected. Fix this.

/* Testing */
clang: Ubuntu clang version 15.0.2-1
gcc: gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0

All patches are based on v6.3-rc1 and have been sitting in linux-next.
No build failures or warnings were observed. All old and new tests in
fstests, selftests, and LTP pass without regressions.

/* Conflicts */
At the time of creating this PR no merge conflicts were reported from
linux-next and no merge conflicts showed up doing a test-merge with
current mainline.

The following changes since commit fe15c26ee26efa11741a7b632e9f23b01aca4cc6:

Linux 6.3-rc1 (2023-03-05 14:52:03 -0800)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/brauner/linux tags/kernel.fork.v6.3-rc2

for you to fetch changes up to 515bddf0ec4155cbd666d72daf5bd68c8b7cd987:

selftests/clone3: test clone3 with CLONE_NEWTIME (2023-03-08 12:31:35 +0100)

Please consider pulling these changes from the signed kernel.fork.v6.3-rc2 tag.

Thanks!
Christian

----------------------------------------------------------------
kernel.fork.v6.3-rc2

----------------------------------------------------------------
Tobias Klauser (2):
fork: allow CLONE_NEWTIME in clone3 flags
selftests/clone3: test clone3 with CLONE_NEWTIME

kernel/fork.c | 2 +-
tools/testing/selftests/clone3/clone3.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)