linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fork: Using clone_flags for legacy clone check
@ 2024-01-31  2:54 Wang Jinchao
  2024-01-31 13:42 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Jinchao @ 2024-01-31  2:54 UTC (permalink / raw)
  To: brauner, viro, linux-kernel; +Cc: stone.xulei, wangjinchao

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>
---
 kernel/fork.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 0d944e92a43f..a6c5383288c9 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2876,8 +2876,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;
 
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fork: Using clone_flags for legacy clone check
  2024-01-31  2:54 [PATCH] fork: Using clone_flags for legacy clone check Wang Jinchao
@ 2024-01-31 13:42 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-01-31 13:42 UTC (permalink / raw)
  To: Wang Jinchao; +Cc: Christian Brauner, stone.xulei, viro, linux-kernel

On Wed, 31 Jan 2024 10:54:41 +0800, Wang Jinchao wrote:
> 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.
> 
> 

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] fork: Using clone_flags for legacy clone check
      https://git.kernel.org/vfs/vfs/c/b473491b6cf8

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-31 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31  2:54 [PATCH] fork: Using clone_flags for legacy clone check Wang Jinchao
2024-01-31 13:42 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).