mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Seiji Nishikawa <snishika@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Amir Goldstein <amir73il@gmail.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Seiji Nishikawa <snishika@redhat.com>
Subject: [PATCH v2 0/3] fsnotify: fix races on mark mask, flags and ignore mask
Date: Sun,  6 Dec 2026 17:06:47 +0900	[thread overview]
Message-ID: <20261206080650.1945355-1-snishika@redhat.com> (raw)

This is v2 of "inotify: do not expose a zero mask while replacing a
watch" [1]. In the review of v1, Jan pointed out that more places need
the same treatment, on the read side and on the write side, and that
send_to_group() clears the ignore mask without a lock and races with the
other updates of the ignore mask. This series covers these points.

Patch 1 is the v1 patch. Patch 2 clears the ignore mask under
mark->lock. Patch 3 adds READ_ONCE() to the remaining reads of
mark->mask, mark->flags and mark->ignore_mask that are done without
mark->lock, and WRITE_ONCE() to the remaining writes of these fields.

[1] https://lore.kernel.org/all/20261019230320.1855016-1-snishika@redhat.com/

Seiji Nishikawa (3):
  inotify: do not expose a zero mask while replacing a watch
  fsnotify: clear the ignore mask under mark->lock
  fsnotify: annotate lockless accesses to mark masks and flags

 fs/notify/dnotify/dnotify.c          |  2 +-
 fs/notify/fanotify/fanotify.c        | 12 +++++++----
 fs/notify/fanotify/fanotify.h        |  7 +++---
 fs/notify/fanotify/fanotify_user.c   | 32 +++++++++++++++++-----------
 fs/notify/fdinfo.c                   | 10 +++++----
 fs/notify/fsnotify.c                 | 24 ++++++++++++++++-----
 fs/notify/inotify/inotify.h          |  7 +++---
 fs/notify/inotify/inotify_fsnotify.c |  2 +-
 fs/notify/inotify/inotify_user.c     | 17 +++++++++++----
 fs/notify/mark.c                     | 32 ++++++++++++++++------------
 include/linux/fsnotify_backend.h     | 17 ++++++++-------
 11 files changed, 103 insertions(+), 59 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.43.0


             reply	other threads:[~2026-12-06  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  8:06 Seiji Nishikawa [this message]
2026-12-06  8:15 ` [PATCH v2 1/3] inotify: do not expose a zero mask while replacing a watch Seiji Nishikawa
2026-12-06  8:15 ` [PATCH v2 2/3] fsnotify: clear the ignore mask under mark->lock Seiji Nishikawa
2026-12-06  8:15 ` [PATCH v2 3/3] fsnotify: annotate lockless accesses to mark masks and flags Seiji Nishikawa

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=20261206080650.1945355-1-snishika@redhat.com \
    --to=snishika@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®