mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
Unbreak mount_capable()
In "consolidate the capability checks in sget_{fc,userns}())" the wrong argument had been passed to mount_capable() by sget_fc(). That mistake had been further obscured later, when switching mount_capable() to fs_context has moved the calculation of bogus argument from sget_fc() to mount_capable() itself. It should've been fc->user_ns all along. Screwed-up-by: Al Viro <viro@zeniv.linux.org.uk> Reported-by: Christian Brauner <christian@brauner.io> Tested-by: Christian Brauner <christian@brauner.io> Reviewed-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -478,13 +478,10 @@ EXPORT_SYMBOL(generic_shutdown_super);
|
|||||||
|
|
||||||
bool mount_capable(struct fs_context *fc)
|
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))
|
if (!(fc->fs_type->fs_flags & FS_USERNS_MOUNT))
|
||||||
return capable(CAP_SYS_ADMIN);
|
return capable(CAP_SYS_ADMIN);
|
||||||
else
|
else
|
||||||
return ns_capable(user_ns, CAP_SYS_ADMIN);
|
return ns_capable(fc->user_ns, CAP_SYS_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user