diff options
author | Matthew Bobrowski <mbobrowski@mbobrowski.org> | 2018-11-07 22:07:14 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-11-13 12:41:04 -0500 |
commit | 9b076f1c0f4869b838a1b7aa0edb5664d47ec8aa (patch) | |
tree | ba17374f906f64d4f8e4c017ba9bc8b5820a02f2 /fs/notify | |
parent | 2d10b23082a7eb8be508b3789f2e7250a88a5ddb (diff) |
fanotify: introduce new event mask FAN_OPEN_EXEC
A new event mask FAN_OPEN_EXEC has been defined so that users have the
ability to receive events specifically when a file has been opened with
the intent to be executed. Events of FAN_OPEN_EXEC type will be
generated when a file has been opened using either execve(), execveat()
or uselib() system calls.
The feature is implemented within fsnotify_open() by generating the
FAN_OPEN_EXEC event type if __FMODE_EXEC is set within file->f_flags.
Signed-off-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 3 | ||||
-rw-r--r-- | fs/notify/fsnotify.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index f4f8359bc597..5a1a15f646ba 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -210,8 +210,9 @@ static int fanotify_handle_event(struct fsnotify_group *group, | |||
210 | BUILD_BUG_ON(FAN_OPEN_PERM != FS_OPEN_PERM); | 210 | BUILD_BUG_ON(FAN_OPEN_PERM != FS_OPEN_PERM); |
211 | BUILD_BUG_ON(FAN_ACCESS_PERM != FS_ACCESS_PERM); | 211 | BUILD_BUG_ON(FAN_ACCESS_PERM != FS_ACCESS_PERM); |
212 | BUILD_BUG_ON(FAN_ONDIR != FS_ISDIR); | 212 | BUILD_BUG_ON(FAN_ONDIR != FS_ISDIR); |
213 | BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC); | ||
213 | 214 | ||
214 | BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 10); | 215 | BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 11); |
215 | 216 | ||
216 | mask = fanotify_group_event_mask(iter_info, mask, data, data_type); | 217 | mask = fanotify_group_event_mask(iter_info, mask, data, data_type); |
217 | if (!mask) | 218 | if (!mask) |
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index d2c34900ae05..b3f58f36a0ab 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -401,7 +401,7 @@ static __init int fsnotify_init(void) | |||
401 | { | 401 | { |
402 | int ret; | 402 | int ret; |
403 | 403 | ||
404 | BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 23); | 404 | BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 24); |
405 | 405 | ||
406 | ret = init_srcu_struct(&fsnotify_mark_srcu); | 406 | ret = init_srcu_struct(&fsnotify_mark_srcu); |
407 | if (ret) | 407 | if (ret) |