We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c0a8ac commit 89156d9Copy full SHA for 89156d9
fs/namespace.c
@@ -1986,6 +1986,7 @@ static void warn_mandlock(void)
1986
static int can_umount(const struct path *path, int flags)
1987
{
1988
struct mount *mnt = real_mount(path->mnt);
1989
+ struct super_block *sb = path->dentry->d_sb;
1990
1991
if (!may_mount())
1992
return -EPERM;
@@ -1995,7 +1996,7 @@ static int can_umount(const struct path *path, int flags)
1995
1996
return -EINVAL;
1997
if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */
1998
- if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN))
1999
+ if (flags & MNT_FORCE && !ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
2000
2001
return 0;
2002
}
0 commit comments