Linux-Fsdevel Archive on
 help / color / Atom feed
From: Jan Kara <>
Cc: Amir Goldstein <>
Subject: Ignore mask handling in fanotify_group_event_mask()
Date: Thu, 21 May 2020 18:24:43 +0200
Message-ID: <> (raw)

Hello Amir!

I was looking into backporting of commit 55bf882c7f13dd "fanotify: fix
merging marks masks with FAN_ONDIR" and realized one oddity in
fanotify_group_event_mask(). The thing is: Even if the mark mask is such
that current event shouldn't trigger on the mark, we still have to take
mark's ignore mask into account.

The most realistic example that would demonstrate the issue that comes to my
mind is:

mount mark watching for FAN_OPEN | FAN_ONDIR.
inode mark on a directory with mask == 0 and ignore_mask == FAN_OPEN.

I'd expect the group will not get any event for opening the dir but the
code in fanotify_group_event_mask() would not prevent event generation. Now
as I've tested the event currently actually does not get generated because
there is a rough test in send_to_group() that actually finds out that there
shouldn't be anything to report and so fanotify handler is actually never
called in such case. But I don't think it's good to have an inconsistent
test in fanotify_group_event_mask(). What do you think?

Jan Kara <>

             reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 16:24 Jan Kara [this message]
2020-05-21 18:10 ` Amir Goldstein
2020-05-23 17:14   ` Amir Goldstein
2020-05-25  7:23     ` Jan Kara
2020-05-25  8:52       ` Amir Goldstein
2020-05-25 12:42         ` Jan Kara

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:

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

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Fsdevel Archive on

Archives are clonable:
	git clone --mirror linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ \
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone