Ignore mask handling in fanotify_group_event_mask()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux