Skip to content

Commit b639585

Browse files
Wang Jinchaobrauner
authored andcommitted
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>
1 parent 6613476 commit b639585

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/fork.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,8 +2875,8 @@ pid_t kernel_clone(struct kernel_clone_args *args)
28752875
* here has the advantage that we don't need to have a separate helper
28762876
* to check for legacy clone().
28772877
*/
2878-
if ((args->flags & CLONE_PIDFD) &&
2879-
(args->flags & CLONE_PARENT_SETTID) &&
2878+
if ((clone_flags & CLONE_PIDFD) &&
2879+
(clone_flags & CLONE_PARENT_SETTID) &&
28802880
(args->pidfd == args->parent_tid))
28812881
return -EINVAL;
28822882

0 commit comments

Comments
 (0)