Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/viro/vfs

Pull mount_capable() fix from Al Viro.

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  Unbreak mount_capable()
  • Loading branch information
Linus Torvalds committed Jul 31, 2019
2 parents b36a155 + c2c44ec commit 5c62075
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,10 @@ EXPORT_SYMBOL(generic_shutdown_super);

bool mount_capable(struct fs_context *fc)
{
struct user_namespace *user_ns = fc->global ? &init_user_ns
: fc->user_ns;

if (!(fc->fs_type->fs_flags & FS_USERNS_MOUNT))
return capable(CAP_SYS_ADMIN);
else
return ns_capable(user_ns, CAP_SYS_ADMIN);
return ns_capable(fc->user_ns, CAP_SYS_ADMIN);
}

/**
Expand Down

0 comments on commit 5c62075

Please sign in to comment.