[RFC PATCH 2/3] add statmnt(2) syscall

Miklos Szeredi miklos at szeredi.hu
Fri Sep 15 09:10:08 UTC 2023


On Thu, 14 Sept 2023 at 22:40, Paul Moore <paul at paul-moore.com> wrote:
>
> On Wed, Sep 13, 2023 at 11:23 AM Miklos Szeredi <mszeredi at redhat.com> wrote:

> ...
>
> > +static int do_statmnt(struct stmt_state *s)
> > +{
> > +       struct statmnt *sm = &s->sm;
> > +       struct mount *m = real_mount(s->mnt);
> > +
> > +       if (!capable(CAP_SYS_ADMIN) &&
> > +           !is_path_reachable(m, m->mnt.mnt_root, &s->root))
> > +               return -EPERM;
>
> I realize statmnt() is different from fstatfs(), but from an access
> control perspective they look a lot alike to me which is why I think
> we should probably have a security_sb_statfs() call here.  Same thing
> for the listmnt() syscall in patch 3/3.

Okay, makes sense.

Thanks,
Miklos



More information about the Linux-security-module-archive mailing list