public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Amir Goldstein <amir73il@gmail.com>, Karel Zak <kzak@redhat.com>,
	Lennart Poettering <lennart@poettering.net>,
	Ian Kent <raven@themaw.net>,
	Christian Brauner <brauner@kernel.org>
Subject: Re: [RFC PATCH] fanotify: notify on mount attach and detach
Date: Thu, 28 Nov 2024 19:57:38 +0000	[thread overview]
Message-ID: <20241128195738.GG3387508@ZenIV> (raw)
In-Reply-To: <20241128144002.42121-1-mszeredi@redhat.com>

On Thu, Nov 28, 2024 at 03:39:59PM +0100, Miklos Szeredi wrote:

> Prior to this patch mount namespace changes could be monitored by polling
> /proc/self/mountinfo, which did not convey any information about what
> changed.
> 
> To monitor an entire mount namespace with this new interface, watches need
> to be added to all existing mounts.  This can be done by performing
> listmount()/statmount() recursively at startup and when a new mount is
> added.

First impression is that it's bloody awful, TBH.  You are calling fsnotify()
under mount_lock; in effect, *ANY* path_init() call done during that time
will be spinning in __read_seqcount_begin() until you are done with that
shite.

And it's _very_ easy to generate a lot of such events with a single syscall;
that doesn't even need sroot - a root in container will suffice.

So... why is it not a DoS?

  parent reply	other threads:[~2024-11-28 19:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 14:39 [RFC PATCH] fanotify: notify on mount attach and detach Miklos Szeredi
2024-11-28 16:43 ` Amir Goldstein
2024-11-29  7:16   ` Miklos Szeredi
2024-11-29 10:23     ` Amir Goldstein
2024-12-03 15:36       ` Miklos Szeredi
2024-11-28 19:57 ` Al Viro [this message]
2024-11-29  7:10   ` Miklos Szeredi
2024-11-29  9:25 ` Christian Brauner
2024-12-03 11:40 ` Karel Zak
2024-12-03 13:03   ` Amir Goldstein
2024-12-03 16:42     ` Jan Kara
2024-12-04 11:30       ` Christian Brauner
2024-12-06 15:18         ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241128195738.GG3387508@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kzak@redhat.com \
    --cc=lennart@poettering.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox