diff options
author | 2025-04-14 15:55:05 +0200 | |
---|---|---|
committer | 2025-06-04 14:46:26 +0200 | |
commit | 24aed3a922a52540ff919b3de0ab020c305e6234 (patch) | |
tree | 1c22da526a8341b40ee060e910c226457396a38d | |
parent | perf/arm-cmn: Add CMN S3 ACPI binding (diff) | |
download | laptop-kernel-24aed3a922a52540ff919b3de0ab020c305e6234.tar.xz laptop-kernel-24aed3a922a52540ff919b3de0ab020c305e6234.zip |
pidfs: move O_RDWR into pidfs_alloc_file()
commit c57f07b235871c9e5bffaccd458dca2d9a62b164 upstream.
Since all pidfds must be O_RDWR currently enfore that directly in the
file allocation function itself instead of letting callers specify it.
Link: https://lore.kernel.org/20250414-work-coredump-v2-1-685bf231f828@kernel.org
Tested-by: Luca Boccassi <luca.boccassi@gmail.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/pidfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/pidfs.c b/fs/pidfs.c index d64a4cbeb0da..50e69a9e104a 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -888,6 +888,7 @@ struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags) return ERR_PTR(-ESRCH); flags &= ~PIDFD_CLONE; + flags |= O_RDWR; pidfd_file = dentry_open(&path, flags, current_cred()); /* Raise PIDFD_THREAD explicitly as do_dentry_open() strips it. */ if (!IS_ERR(pidfd_file)) |