]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: (namespace) autofs4: Use real_cred for requestor's ids
authorSeth Forshee <seth.forshee@canonical.com>
Mon, 3 Oct 2016 13:18:03 +0000 (08:18 -0500)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:06:32 +0000 (08:06 -0500)
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>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/autofs4/waitq.c

index 35b755e79c2d9b311d0eb899dd749580cb42b209..2b369c8ccfabc1d17045226d8db3bf22f1585c35 100644 (file)
@@ -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 */