summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorWang Jinchao <wangjinchao@xfusion.com>2024-01-31 10:54:41 +0800
committerChristian Brauner <brauner@kernel.org>2024-02-02 13:12:28 +0100
commitb639585e71e63008373d3a9fd060b87315fe7ea8 (patch)
treece3fab4d9b0ad9c8330ed42f030f4112e46cd428 /kernel/fork.c
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
downloadlinux-b639585e71e63008373d3a9fd060b87315fe7ea8.tar.gz
linux-b639585e71e63008373d3a9fd060b87315fe7ea8.tar.bz2
linux-b639585e71e63008373d3a9fd060b87315fe7ea8.zip
fork: Using clone_flags for legacy clone check
In the current implementation of clone(), there is a line that initializes `u64 clone_flags = args->flags` at the top. This means that there is no longer a need to use args->flags for the legacy clone check. Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com> Link: https://lore.kernel.org/r/202401311054+0800-wangjinchao@xfusion.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 47ff3b35352e..95647c66309f 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2875,8 +2875,8 @@ pid_t kernel_clone(struct kernel_clone_args *args)
* here has the advantage that we don't need to have a separate helper
* to check for legacy clone().
*/
- if ((args->flags & CLONE_PIDFD) &&
- (args->flags & CLONE_PARENT_SETTID) &&
+ if ((clone_flags & CLONE_PIDFD) &&
+ (clone_flags & CLONE_PARENT_SETTID) &&
(args->pidfd == args->parent_tid))
return -EINVAL;