]> git.baikalelectronics.ru Git - kernel.git/commit
fanotify: Avoid lost events due to ENOMEM for unlimited queues
authorJan Kara <jack@suse.cz>
Wed, 21 Feb 2018 13:10:59 +0000 (14:10 +0100)
committerJan Kara <jack@suse.cz>
Tue, 27 Feb 2018 09:25:33 +0000 (10:25 +0100)
commit44140e0d3fcf60224c72a4f33c7db31ef417044b
treeaccb9faea9a7b5160d5e35f320007938e2f76af9
parent119211c520c275c3a522cb30dd7b6dac6e09bf7b
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>
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c