diff options
author | Jan Kara <jack@suse.cz> | 2018-02-21 14:10:59 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-02-27 10:25:33 +0100 |
commit | 1f5eaa90010ed7cf0ae90a526c48657d02c6086f (patch) | |
tree | accb9faea9a7b5160d5e35f320007938e2f76af9 /fs/notify/fanotify/fanotify_user.c | |
parent | f0c4a81711cb773b60cb8f90173e6491e67bf74f (diff) | |
download | linux-1f5eaa90010ed7cf0ae90a526c48657d02c6086f.tar.gz linux-1f5eaa90010ed7cf0ae90a526c48657d02c6086f.tar.bz2 linux-1f5eaa90010ed7cf0ae90a526c48657d02c6086f.zip |
fanotify: Avoid lost events due to ENOMEM for unlimited queues
Fanotify queues of unlimited length do not expect events can be lost.
Since these queues are used for system auditing and other security
related tasks, loosing events can even have security implications.
Currently, since the allocation is small (32-bytes), it cannot fail
however when we start accounting events in memcgs, allocation can start
failing. So avoid loosing events due to failure to allocate memory by
making event allocation use __GFP_NOFAIL.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/fanotify/fanotify_user.c')
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index c07eb3d655ea..72e367822efb 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -757,7 +757,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) group->fanotify_data.user = user; atomic_inc(&user->fanotify_listeners); - oevent = fanotify_alloc_event(NULL, FS_Q_OVERFLOW, NULL); + oevent = fanotify_alloc_event(group, NULL, FS_Q_OVERFLOW, NULL); if (unlikely(!oevent)) { fd = -ENOMEM; goto out_destroy_group; |