From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: stable@vger.kernel.org, Amir Goldstein <amir73il@gmail.com>,
Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 4.4] fanotify: fix logic of events on child
Date: Sun, 22 Apr 2018 12:45:38 +0200 [thread overview]
Message-ID: <20180422104538.GA26984@kroah.com> (raw)
In-Reply-To: <20180422101406.18529-1-natechancellor@gmail.com>
On Sun, Apr 22, 2018 at 03:14:06AM -0700, Nathan Chancellor wrote:
> From: Amir Goldstein <amir73il@gmail.com>
>
> commit 54a307ba8d3cd00a3902337ffaae28f436eeb1a4 upstream.
>
> When event on child inodes are sent to the parent inode mark and
> parent inode mark was not marked with FAN_EVENT_ON_CHILD, the event
> will not be delivered to the listener process. However, if the same
> process also has a mount mark, the event to the parent inode will be
> delivered regadless of the mount mark mask.
>
> This behavior is incorrect in the case where the mount mark mask does
> not contain the specific event type. For example, the process adds
> a mark on a directory with mask FAN_MODIFY (without FAN_EVENT_ON_CHILD)
> and a mount mark with mask FAN_CLOSE_NOWRITE (without FAN_ONDIR).
>
> A modify event on a file inside that directory (and inside that mount)
> should not create a FAN_MODIFY event, because neither of the marks
> requested to get that event on the file.
>
> Fixes: 1968f5eed54c ("fanotify: use both marks when possible")
> Cc: stable <stable@vger.kernel.org>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
> [natechancellor: Fix small conflict due to lack of 3cd5eca8d7a2f]
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> fs/notify/fanotify/fanotify.c | 34 +++++++++++++++-------------------
> 1 file changed, 15 insertions(+), 19 deletions(-)
Thanks for this, now queued up to 4.9.y, 4.4.y, and 3.18.y
greg k-h
prev parent reply other threads:[~2018-04-22 10:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-22 10:14 [PATCH 4.4] fanotify: fix logic of events on child Nathan Chancellor
2018-04-22 10:45 ` Greg Kroah-Hartman [this message]
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=20180422104538.GA26984@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=natechancellor@gmail.com \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).