]> git.baikalelectronics.ru Git - kernel.git/commit
fork: allow CLONE_NEWTIME in clone3 flags
authorTobias Klauser <tklauser@distanz.ch>
Wed, 8 Mar 2023 10:51:26 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:14 +0000 (08:50 +0100)
commit8d6f57f8610d74669a9b632c96b061fa72f2a84f
tree2f7dab97b479a41533604ae596792a5105aeb8d1
parent3bbf37abd933850fdb8ec955b0685d4a23d9c6a1
fork: allow CLONE_NEWTIME in clone3 flags

commit f84b9b232eb469aa76c776df7b98e8d9557df94e upstream.

Currently, calling clone3() with CLONE_NEWTIME in clone_args->flags
fails with -EINVAL. This is because CLONE_NEWTIME intersects with
CSIGNAL. However, CSIGNAL was deprecated when clone3 was introduced in
commit 2857618838c4 ("fork: add clone3"), allowing re-use of that part
of clone flags.

Fix this by explicitly allowing CLONE_NEWTIME in clone3_args_valid. This
is also in line with the respective check in check_unshare_flags which
allow CLONE_NEWTIME for unshare().

Fixes: 6863f52c2620 ("ns: Introduce Time Namespace")
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/fork.c