Skip to content

Commit c57f07b

Browse files
committed
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/[email protected] Tested-by: Luca Boccassi <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent e1b477c commit c57f07b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/pidfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,7 @@ struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags)
892892
return ERR_PTR(-ESRCH);
893893

894894
flags &= ~PIDFD_STALE;
895+
flags |= O_RDWR;
895896
pidfd_file = dentry_open(&path, flags, current_cred());
896897
/* Raise PIDFD_THREAD explicitly as do_dentry_open() strips it. */
897898
if (!IS_ERR(pidfd_file))

0 commit comments

Comments
 (0)