From: Christian Brauner <brauner@kernel.org>
To: Paul Moore <paul@paul-moore.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
Miklos Szeredi <mszeredi@redhat.com>,
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>,
Alexander Viro <viro@zeniv.linux.org.uk>,
selinux@vger.kernel.org, linux-security-module@vger.kernel.org,
selinux-refpolicy@vger.kernel.org
Subject: Re: [PATCH v5 2/3] fanotify: notify on mount attach and detach
Date: Tue, 4 Feb 2025 11:19:32 +0100 [thread overview]
Message-ID: <20250204-empfahl-feinmechaniker-fbfdee97f4bd@brauner> (raw)
In-Reply-To: <CAHC9VhR+zEms9XQk1HWNWG9cF9606g5KP83pbRQa4XesyORaBA@mail.gmail.com>
On Fri, Jan 31, 2025 at 09:28:31AM -0500, Paul Moore wrote:
> On Fri, Jan 31, 2025 at 5:53 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
> > On Thu, 30 Jan 2025 at 22:06, Paul Moore <paul@paul-moore.com> wrote:
> > > On Wed, Jan 29, 2025 at 11:58 AM Miklos Szeredi <mszeredi@redhat.com> wrote:
> > > >
> > > > Add notifications for attaching and detaching mounts. The following new
> > > > event masks are added:
> > > >
> > > > FAN_MNT_ATTACH - Mount was attached
> > > > FAN_MNT_DETACH - Mount was detached
> > > >
> > > > If a mount is moved, then the event is reported with (FAN_MNT_ATTACH |
> > > > FAN_MNT_DETACH).
> > > >
> > > > These events add an info record of type FAN_EVENT_INFO_TYPE_MNT containing
> > > > these fields identifying the affected mounts:
> > > >
> > > > __u64 mnt_id - the ID of the mount (see statmount(2))
> > > >
> > > > FAN_REPORT_MNT must be supplied to fanotify_init() to receive these events
> > > > and no other type of event can be received with this report type.
> > > >
> > > > Marks are added with FAN_MARK_MNTNS, which records the mount namespace from
> > > > an nsfs file (e.g. /proc/self/ns/mnt).
> > > >
> > > > Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> > > > ---
> > > > fs/mount.h | 2 +
> > > > fs/namespace.c | 14 +++--
> > > > fs/notify/fanotify/fanotify.c | 38 +++++++++++--
> > > > fs/notify/fanotify/fanotify.h | 18 +++++++
> > > > fs/notify/fanotify/fanotify_user.c | 87 +++++++++++++++++++++++++-----
> > > > fs/notify/fdinfo.c | 5 ++
> > > > include/linux/fanotify.h | 12 +++--
> > > > include/uapi/linux/fanotify.h | 10 ++++
> > > > security/selinux/hooks.c | 4 ++
> > > > 9 files changed, 167 insertions(+), 23 deletions(-)
> > >
> > > ...
> > >
> > > > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> > > > index 7b867dfec88b..06d073eab53c 100644
> > > > --- a/security/selinux/hooks.c
> > > > +++ b/security/selinux/hooks.c
> > > > @@ -3395,6 +3395,10 @@ static int selinux_path_notify(const struct path *path, u64 mask,
> > > > case FSNOTIFY_OBJ_TYPE_INODE:
> > > > perm = FILE__WATCH;
> > > > break;
> > > > + case FSNOTIFY_OBJ_TYPE_MNTNS:
> > > > + /* Maybe introduce FILE__WATCH_MOUNTNS? */
> > > > + perm = FILE__WATCH_MOUNT;
> > > > + break;
> > > > default:
> > > > return -EINVAL;
> > > > }
> > >
> > > Ignoring for a moment that this patch was merged without an explicit
> > > ACK for the SELinux changes, let's talk about these SELinux changes
> > > ...
> > >
> > > I understand that you went with the "simpler version" because you
> > > didn't believe the discussion was converging, which is fair, however,
> > > I believe Daniel's argument is convincing enough to warrant the new
> > > permission.
> >
> > Fine, I'll work on this.
>
> Great, thanks.
>
> > > Yes, it has taken me approximately two days to find the
> > > time to revisit this topic and reply with some clarity, but personally
> > > I feel like that is not an unreasonable period of time, especially for
> > > a new feature discussion occurring during the merge window.
> >
> > Definitely not.
> >
> > Christian is definitely very responsive and quick to queue things up,
> > and that can have drawbacks. In this he made it clear that he wants
> > to get this queued ASAP regardless of whether there's decision on the
> > SELinux side or not.
>
> When one merges code that affects another subsystem without an
> explicit ACK from the affected subsystem when the maintainer has asked
> for others to clear the code change with an ACK, it's hard to see that
> as anything but bad behavior at its best and reckless behavior at its
> worst. It is doubly troubling in cases like this where the code
> change is user visible.
>
> > What I think might be a good thing if Christian could record
> > conditional NAKs such as this one from you, that need to be worked on
> > before sending a feature upstream. That would prevent wrong code
> > being sent upstream due to lack of attention.
>
> Christian's merge notification email already has this section:
>
> "Please report any outstanding bugs that were missed
> during review in a new review to the original patch series
> allowing us to drop it."
>
> ... and to be fair, the vfs-6.15.mount branch mentioned in the
> notification does appear to be gone.
The branch is very much alive but it has never been public for very
obvious reasons: new patches don't appear in -next or elsewhere until
the merge window is closed. They will be pushed out today.
next prev parent reply other threads:[~2025-02-04 10:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 16:57 [PATCH v5 0/3] mount notification Miklos Szeredi
2025-01-29 16:57 ` [PATCH v5 1/3] fsnotify: add mount notification infrastructure Miklos Szeredi
2025-02-11 13:05 ` Jan Kara
2025-01-29 16:58 ` [PATCH v5 2/3] fanotify: notify on mount attach and detach Miklos Szeredi
2025-01-30 21:05 ` Paul Moore
2025-01-31 10:53 ` Miklos Szeredi
2025-01-31 14:28 ` Paul Moore
2025-02-04 10:19 ` Christian Brauner [this message]
2025-02-04 10:20 ` Christian Brauner
2025-01-31 12:09 ` Christian Brauner
2025-01-31 14:39 ` Paul Moore
2025-02-04 10:07 ` Christian Brauner
2025-02-04 23:52 ` Paul Moore
2025-02-11 13:32 ` Jan Kara
2025-02-13 11:59 ` Miklos Szeredi
2025-02-13 13:08 ` Amir Goldstein
2025-01-29 16:58 ` [PATCH v5 3/3] vfs: add notifications for " Miklos Szeredi
2025-02-11 13:04 ` Jan Kara
2025-01-30 16:07 ` [PATCH v5 0/3] mount notification Christian Brauner
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=20250204-empfahl-feinmechaniker-fbfdee97f4bd@brauner \
--to=brauner@kernel.org \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=kzak@redhat.com \
--cc=lennart@poettering.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@redhat.com \
--cc=paul@paul-moore.com \
--cc=raven@themaw.net \
--cc=selinux-refpolicy@vger.kernel.org \
--cc=selinux@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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