mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] fsnotify: fix races on mark mask, flags and ignore mask
@ 2026-12-06  8:06 Seiji Nishikawa
  2026-12-06  8:15 ` [PATCH v2 1/3] inotify: do not expose a zero mask while replacing a watch Seiji Nishikawa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Seiji Nishikawa @ 2026-12-06  8:06 UTC (permalink / raw)
  To: Jan Kara; +Cc: Amir Goldstein, linux-fsdevel, linux-kernel, Seiji Nishikawa

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-06  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-06  8:06 [PATCH v2 0/3] fsnotify: fix races on mark mask, flags and ignore mask Seiji Nishikawa
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

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®