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:   Fri, 18 Nov 2022 11:18:36 -0800
From:   Ivan Babrou <ivan@...udflare.com>
To:     Brian Foster <bfoster@...hat.com>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-team@...udflare.com, Alexey Dobriyan <adobriyan@...il.com>,
        Al Viro <viro@...iv.linux.org.uk>,
        "Theodore Ts'o" <tytso@....edu>,
        David Laight <David.Laight@...lab.com>,
        Jonathan Corbet <corbet@....net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Christoph Anton Mitterer <mail@...istoph.anton.mitterer.name>,
        Mike Rapoport <rppt@...nel.org>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Kalesh Singh <kaleshsingh@...gle.com>
Subject: Re: [PATCH v4] proc: report open files as size in stat() for /proc/pid/fd

On Fri, Nov 18, 2022 at 11:10 AM Brian Foster <bfoster@...hat.com> wrote:
> > +static int proc_fd_getattr(struct user_namespace *mnt_userns,
> > +                     const struct path *path, struct kstat *stat,
> > +                     u32 request_mask, unsigned int query_flags)
> > +{
> > +     struct inode *inode = d_inode(path->dentry);
> > +     int rv = 0;
> > +
> > +     generic_fillattr(&init_user_ns, inode, stat);
> > +
>
> Sorry I missed this on v3, but shouldn't this pass through the
> mnt_userns parameter?

The mnt_userns parameter was added in 549c729 (fs: make helpers idmap
mount aware), and it's not passed anywhere in fs/proc.

Looking at other uses of generic_fillattr, all of them use "init_user_ns":

$ rg generic_fillattr fs/proc
fs/proc/proc_net.c
301: generic_fillattr(&init_user_ns, inode, stat);

fs/proc/base.c
1970: generic_fillattr(&init_user_ns, inode, stat);
3856: generic_fillattr(&init_user_ns, inode, stat);

fs/proc/root.c
315: generic_fillattr(&init_user_ns, d_inode(path->dentry), stat);

fs/proc/generic.c
150: generic_fillattr(&init_user_ns, inode, stat);

fs/proc/proc_sysctl.c
841: generic_fillattr(&init_user_ns, inode, stat);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ