All of lore.kernel.org
 help / color / mirror / Atom feed
* Missing check for CAP_SYS_ADMIN before calling reconfigure_super()
@ 2021-05-31 15:17 tianyu zhou
  0 siblings, 0 replies; only message in thread
From: tianyu zhou @ 2021-05-31 15:17 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel

Hi, there exists a check for CAP_SYS_ADMIN in do_remount(),
do_umount() and vfs_fsconfig_locked() before they finally call
reconfigure_super().

---------------------
// fs/namespace.c
static int do_umount(struct mount *mnt, int flags)
{
        ...
        if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
            return -EPERM;
        return do_umount_root(sb);
        ...
}

static int do_umount_root(struct super_block *sb)
{
                ...
                ret = reconfigure_super(fc);
                ...
}
---------------------

However, for function do_emergency_remount_callback(), vfs_get_super()
and reconfigure_single() in fs/super.c, there is no such check for
CAP_SYS_ADMIN before calling reconfigure_super(), neither do their
callers.

Is this a missing check bug which may break the protection for superblock?

Thanks!

Best regards,
Tianyu

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-31 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 15:17 Missing check for CAP_SYS_ADMIN before calling reconfigure_super() tianyu zhou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.