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

Thadeu Lima de Souza Cascardo cascardo at canonical.com
Wed Jun 30 18:35:48 UTC 2021


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 at canonical.com>
---
 fs/proc/base.c | 4 ----
 1 file changed, 4 deletions(-)

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;
-- 
2.30.2




More information about the kernel-team mailing list