Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17]

Al Viro
2020-03-06T21:28:36Z

On Fri, Mar 06, 2020 at 09:51:50PM +0100, Miklos Szeredi wrote:
> On Fri, Mar 6, 2020 at 9:49 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > On Fri, Mar 06, 2020 at 08:45:23PM +0000, Al Viro wrote:
> > > On Fri, Mar 06, 2020 at 08:38:44PM +0000, Al Viro wrote:
> > > > On Fri, Mar 06, 2020 at 08:37:05PM +0000, Al Viro wrote:
> > > >
> > > > > You are misreading mntput_no_expire(), BTW - your get_mount() can
> > > > > bloody well race with umount(2), hitting the moment when we are done
> > > > > figuring out whether it's busy but hadn't cleaned ->mnt_ns (let alone
> > > > > set MNT_DOOMED) yet. If somebody calls umount(2) on a filesystem that
> > > > > is not mounted anywhere else, they are not supposed to see the sucker
> > > > > return 0 until the filesystem is shut down. You break that.
> > > >
> > > > While we are at it, d_alloc_parallel() requires i_rwsem on parent held
> > > > at least shared.
> > >
> > > Egads... Let me see if I got it right - you are providing procfs symlinks
> > > to objects on the internal mount of that thing. And those objects happen
> > > to be directories, so one can get to their parent that way. Or am I misreading
> > > that thing?
> >
> > IDGI. You have (in your lookup) kstrtoul, followed by snprintf, followed
> > by strcmp and WARN_ON() in case of mismatch? Is there any point in having
> > stat(2) on "00" spew into syslog? Confused...
>
> The WARN_ON() is for the buffer overrun, not for the strcmp mismatch.

That makes even less sense - buffer overrun on snprintf of an int into
32-character array? That's what, future-proofing it for the time we
manage to issue 10^31 syscalls since the (much closer) moment when we
get 128bit int?