Skip to content

Commit e8ea349

Browse files
committed
pidfs: move O_RDWR into pidfs_alloc_file()
JIRA: https://issues.redhat.com/browse/RHEL-113598 Conflicts: A merge conflict due to missing upstream commit a71f402 ("pidfs: get rid of __pidfd_prepare()"). commit c57f07b Author: Christian Brauner <brauner@kernel.org> Date: Mon, 14 Apr 2025 15:55:05 +0200 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> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent e8f4cf7 commit e8ea349

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
@@ -888,6 +888,7 @@ struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags)
888888
return ERR_PTR(-ESRCH);
889889

890890
flags &= ~PIDFD_CLONE;
891+
flags |= O_RDWR;
891892
pidfd_file = dentry_open(&path, flags, current_cred());
892893
/* Raise PIDFD_THREAD explicitly as do_dentry_open() strips it. */
893894
if (!IS_ERR(pidfd_file))

0 commit comments

Comments
 (0)