diff mbox series

[SRU,Bionic] UBUNTU: SAUCE: Revert "proc: Check /proc/$pid/attr/ writes against file opener"

Message ID 20210630183548.211753-3-cascardo@canonical.com
State New
Headers show
Series [SRU,Bionic] UBUNTU: SAUCE: Revert "proc: Check /proc/$pid/attr/ writes against file opener" | expand

Commit Message

Thadeu Lima de Souza Cascardo June 30, 2021, 6:35 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1934187

This reverts commit cec2a1d5bb20a68d580cf5dececa3edef38b88e8, which is
upstream commit bfb819ea20ce8bbeeba17e1a6418bf8bda91fc28.

This has been shown to cause failures with lxd, as the opener process had
different privileges than the writer, preventing lxd to be able to create
new processes inside a container when setting apparmor confinement.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 fs/proc/base.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/proc/base.c b/fs/proc/base.c
index fc35a8a3e481..bb9e020317d0 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2588,10 +2588,6 @@  static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
 	ssize_t length;
 	struct task_struct *task = get_proc_task(inode);
 
-	/* A task may only write when it was the opener. */
-	if (file->f_cred != current_real_cred())
-		return -EPERM;
-
 	length = -ESRCH;
 	if (!task)
 		goto out_no_task;