From: Wang Jinchao <wangjinchao@xfusion.com>
To: <brauner@kernel.org>, <viro@zeniv.linux.org.uk>,
<linux-kernel@vger.kernel.org>
Cc: <stone.xulei@xfusion.com>, <wangjinchao@xfusion.com>
Subject: [PATCH] fork: Using clone_flags for legacy clone check
Date: Wed, 31 Jan 2024 10:54:41 +0800 [thread overview]
Message-ID: <202401311054+0800-wangjinchao@xfusion.com> (raw)
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
next reply other threads:[~2024-01-31 3:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 2:54 Wang Jinchao [this message]
2024-01-31 13:42 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202401311054+0800-wangjinchao@xfusion.com \
--to=wangjinchao@xfusion.com \
--cc=brauner@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stone.xulei@xfusion.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®