lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Nov 2023 08:58:32 +0100
From:   Christian Brauner <brauner@...nel.org>
To:     Miklos Szeredi <mszeredi@...hat.com>
Cc:     linux-fsdevel@...r.kernel.org, Paul Moore <paul@...l-moore.com>,
        linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
        linux-man@...r.kernel.org, linux-security-module@...r.kernel.org,
        Karel Zak <kzak@...hat.com>, Ian Kent <raven@...maw.net>,
        David Howells <dhowells@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <christian@...uner.io>,
        Amir Goldstein <amir73il@...il.com>,
        Matthew House <mattlloydhouse@...il.com>,
        Florian Weimer <fweimer@...hat.com>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v4 4/6] add statmount(2) syscall

> > +static int do_statmount(struct stmt_state *s)
> > +{
> > +	struct statmnt *sm = &s->sm;
> > +	struct mount *m = real_mount(s->mnt);
> > +	size_t copysize = min_t(size_t, s->bufsize, sizeof(*sm));
> > +	int err;
> > +
> > +	err = security_sb_statfs(s->mnt->mnt_root);
> > +	if (err)
> > +		return err;
> > +
> > +	if (!capable(CAP_SYS_ADMIN) &&
> > +	    !is_path_reachable(m, m->mnt.mnt_root, &s->root))
> > +		return -EPERM;
> 
> In order to be consistent with our typical access control ordering,
> please move the security_sb_statfs() call down to here, after the
> capability checks.

I've moved the security_sb_statfs() calls accordingly.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ