Skip to content

Commit 8aed8ce

Browse files
committed
fanotify: compare fsid when merging name event
When merging name events, fsids of the two involved events have to match. Otherwise we could merge events from two different filesystems and thus effectively loose the second event. Backporting note: Although the commit cacfb95 introducing this bug was merged for 5.7, the relevant code didn't get used in the end until 7e8283a ("fanotify: report parent fid + name + child fid") which will be merged with this patch. So there's no need for backporting this. Fixes: cacfb95 ("fanotify: record name info for FAN_DIR_MODIFY event") Reported-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent b9a1b97 commit 8aed8ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/notify/fanotify/fanotify.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ static bool fanotify_name_event_equal(struct fanotify_name_event *fne1,
8282
if (!info1->dir_fh_totlen)
8383
return false;
8484

85+
if (!fanotify_fsid_equal(&fne1->fsid, &fne2->fsid))
86+
return false;
87+
8588
return fanotify_info_equal(info1, info2);
8689
}
8790

0 commit comments

Comments
 (0)