Skip to content

Commit

Permalink
do_mount(): fix a leak introduced in 3.9 ("mount: consolidate permiss…
Browse files Browse the repository at this point in the history
…ion checks")

Cc: stable@vger.kernel.org
Bisected-by: Michael Leun <lkml20130126@newton.leun.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 4, 2013
1 parent 0279b3c commit 0d5cadb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name,

retval = security_sb_mount(dev_name, &path,
type_page, flags, data_page);
if (!retval && !may_mount())
retval = -EPERM;
if (retval)
goto dput_out;

if (!may_mount())
return -EPERM;

/* Default to relatime unless overriden */
if (!(flags & MS_NOATIME))
mnt_flags |= MNT_RELATIME;
Expand Down

0 comments on commit 0d5cadb

Please sign in to comment.