mirror of https://gitee.com/openkylin/linux.git
do_mount(): fix a leak introduced in 3.9 ("mount: consolidate permission checks")
Cc: stable@vger.kernel.org Bisected-by: Michael Leun <lkml20130126@newton.leun.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
0279b3c0ad
commit
0d5cadb87e
|
@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name,
|
||||||
|
|
||||||
retval = security_sb_mount(dev_name, &path,
|
retval = security_sb_mount(dev_name, &path,
|
||||||
type_page, flags, data_page);
|
type_page, flags, data_page);
|
||||||
|
if (!retval && !may_mount())
|
||||||
|
retval = -EPERM;
|
||||||
if (retval)
|
if (retval)
|
||||||
goto dput_out;
|
goto dput_out;
|
||||||
|
|
||||||
if (!may_mount())
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
/* Default to relatime unless overriden */
|
/* Default to relatime unless overriden */
|
||||||
if (!(flags & MS_NOATIME))
|
if (!(flags & MS_NOATIME))
|
||||||
mnt_flags |= MNT_RELATIME;
|
mnt_flags |= MNT_RELATIME;
|
||||||
|
|
Loading…
Reference in New Issue