Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bff7ecc authored by Lino Sanfilippo's avatar Lino Sanfilippo Committed by Eric Paris
Browse files

Ensure FMODE_NONOTIFY is not set by userspace



    In fsnotify_open() ensure that FMODE_NONOTIFY is never set by userspace.
    Also always call fsnotify_parent and fsnotify.

Signed-off-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 1a5cea72
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -235,11 +235,12 @@ static inline void fsnotify_open(struct file *file)
	if (S_ISDIR(inode->i_mode))
		mask |= FS_ISDIR;

	if (!(file->f_mode & FMODE_NONOTIFY)) {
	/* FMODE_NONOTIFY must never be set from user */
	file->f_mode &= ~FMODE_NONOTIFY;

	fsnotify_parent(path, NULL, mask);
	fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0);
}
}

/*
 * fsnotify_close - file was closed