diff options
author | Lino Sanfilippo <LinoSanfilippo@gmx.de> | 2010-10-29 06:02:17 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-10-30 14:07:40 -0400 |
commit | 6bff7eccb0d9bdef4123aad5399e73cbc26683a6 (patch) | |
tree | 59ebbe6cdc9480008d80670383a6f667f766a3cb | |
parent | 1a5cea7215f7c6bd3c960d7b44e864f3a73d1ad4 (diff) |
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: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
-rw-r--r-- | include/linux/fsnotify.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index ecb43b33d181..5c185fa27089 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -235,10 +235,11 @@ static inline void fsnotify_open(struct file *file) | |||
235 | if (S_ISDIR(inode->i_mode)) | 235 | if (S_ISDIR(inode->i_mode)) |
236 | mask |= FS_ISDIR; | 236 | mask |= FS_ISDIR; |
237 | 237 | ||
238 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 238 | /* FMODE_NONOTIFY must never be set from user */ |
239 | fsnotify_parent(path, NULL, mask); | 239 | file->f_mode &= ~FMODE_NONOTIFY; |
240 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 240 | |
241 | } | 241 | fsnotify_parent(path, NULL, mask); |
242 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | ||
242 | } | 243 | } |
243 | 244 | ||
244 | /* | 245 | /* |