projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1b477c
)
pidfs: move O_RDWR into pidfs_alloc_file()
author
Christian Brauner
<brauner@kernel.org>
Mon, 14 Apr 2025 13:55:05 +0000
(15:55 +0200)
committer
Christian Brauner
<brauner@kernel.org>
Fri, 2 May 2025 12:28:45 +0000
(14:28 +0200)
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>
fs/pidfs.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/pidfs.c
b/fs/pidfs.c
index 9d993ecadad75cbbb98b40e1507ae7a49e4932dc..3b39e471840b1b210de782d508fca830b4e541db 100644
(file)
--- a/
fs/pidfs.c
+++ b/
fs/pidfs.c
@@
-892,6
+892,7
@@
struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags)
return ERR_PTR(-ESRCH);
flags &= ~PIDFD_STALE;
+ 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))