diff mbox

[xenial/yakkety,SRU] UBUNTU: SAUCE: (namespace) autofs4: Use real_cred for requestor's ids

Message ID 1475500683-74002-1-git-send-email-seth.forshee@canonical.com
State New
Headers show

Commit Message

Seth Forshee Oct. 3, 2016, 1:18 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1629204

autofs passes the uid and gid of the user requesting a mount to
userspace, taking them from current->cred. ca6fe3344554 "fs: Call
d_automount with the filesystems creds" causes a regression as
current->cred is now the credentials of real root during automount
and not the credentials of the user. Fix this by taking the ids
from current->real_cred instead.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---

This change will also be going upstream but hasn't yet been applied to
any upstream trees.

 fs/autofs4/waitq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tim Gardner Oct. 3, 2016, 1:50 p.m. UTC | #1

Brad Figg Oct. 3, 2016, 3:35 p.m. UTC | #2

Tim Gardner Oct. 4, 2016, 2:12 p.m. UTC | #3

diff mbox

Patch

diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 35b755e79c2d..2b369c8ccfab 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -427,8 +427,8 @@  int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
 		memcpy(&wq->name, &qstr, sizeof(struct qstr));
 		wq->dev = autofs4_get_dev(sbi);
 		wq->ino = autofs4_get_ino(sbi);
-		wq->uid = current_uid();
-		wq->gid = current_gid();
+		wq->uid = current_real_cred()->uid;
+		wq->gid = current_real_cred()->gid;
 		wq->pid = pid;
 		wq->tgid = tgid;
 		wq->status = -EINTR; /* Status return if interrupted */