aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-04 14:40:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-04 14:40:51 -0400
commit0d5cadb87e0fa764db7fa0b78d8a6f173cb475a1 (patch)
treef3c926479384f1b1292260b7463f79b8705d70de /fs/namespace.c
parent0279b3c0ada1d78882f24acf94ac4595bd657a89 (diff)
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>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b4f96a5230a3..b68eef2d592a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name,
2284 2284
2285 retval = security_sb_mount(dev_name, &path, 2285 retval = security_sb_mount(dev_name, &path,
2286 type_page, flags, data_page); 2286 type_page, flags, data_page);
2287 if (!retval && !may_mount())
2288 retval = -EPERM;
2287 if (retval) 2289 if (retval)
2288 goto dput_out; 2290 goto dput_out;
2289 2291
2290 if (!may_mount())
2291 return -EPERM;
2292
2293 /* Default to relatime unless overriden */ 2292 /* Default to relatime unless overriden */
2294 if (!(flags & MS_NOATIME)) 2293 if (!(flags & MS_NOATIME))
2295 mnt_flags |= MNT_RELATIME; 2294 mnt_flags |= MNT_RELATIME;