mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
pidfs: move O_RDWR into pidfs_alloc_file()
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>
This commit is contained in:
parent
e1b477c213
commit
c57f07b235
1 changed files with 1 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue