linux-stable/fs/autofs4
Eric W. Biederman 069d5ac9ae autofs: Fix automounts by using current_real_cred()->uid
Seth Forshee reports that in 4.8-rcN some automounts are failing
because the requesting the automount changed.

The relevant call path is:
follow_automount()
    ->d_automount
    autofs4_d_automount
       autofs4_mount_wait
           autofs4_wait

In autofs4_wait wq_uid and wq_gid are set to current_uid() and
current_gid respectively.  With follow_automount now overriding creds
uid that we export to userspace changes and that breaks existing
setups.

To remove the regression set wq_uid and wq_gid from
current_real_cred()->uid and current_real_cred()->gid respectively.
This restores the current behavior as current->real_cred is identical
to current->cred except when override creds are used.

Cc: stable@vger.kernel.org
Fixes: aeaa4a79ff ("fs: Call d_automount with the filesystems creds")
Reported-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2016-09-30 12:48:01 -05:00
..
autofs_i.h autofs races 2016-06-12 11:24:46 -04:00
dev-ioctl.c autofs4: use pr_xxx() macros directly for logging 2016-03-15 16:55:16 -07:00
expire.c autofs races 2016-06-12 11:24:46 -04:00
init.c autofs4: coding style fixes 2016-03-15 16:55:16 -07:00
inode.c autofs4: use pr_xxx() macros directly for logging 2016-03-15 16:55:16 -07:00
Kconfig fs/Kconfig: move autofs, autofs4 out 2009-01-22 13:15:54 +03:00
Makefile autofs4: add miscellaneous device for ioctls 2008-10-16 11:21:39 -07:00
root.c qstr: constify instances in autofs4 2016-07-20 23:30:06 -04:00
symlink.c autofs4: coding style fixes 2016-03-15 16:55:16 -07:00
waitq.c autofs: Fix automounts by using current_real_cred()->uid 2016-09-30 12:48:01 -05:00