|
@@ -148,10 +148,13 @@ struct fanotify_event_info *fanotify_alloc_event(struct fsnotify_group *group,
|
|
|
/*
|
|
/*
|
|
|
* For queues with unlimited length lost events are not expected and
|
|
* For queues with unlimited length lost events are not expected and
|
|
|
* can possibly have security implications. Avoid losing events when
|
|
* can possibly have security implications. Avoid losing events when
|
|
|
- * memory is short.
|
|
|
|
|
|
|
+ * memory is short. For the limited size queues, avoid OOM killer in the
|
|
|
|
|
+ * target monitoring memcg as it may have security repercussion.
|
|
|
*/
|
|
*/
|
|
|
if (group->max_events == UINT_MAX)
|
|
if (group->max_events == UINT_MAX)
|
|
|
gfp |= __GFP_NOFAIL;
|
|
gfp |= __GFP_NOFAIL;
|
|
|
|
|
+ else
|
|
|
|
|
+ gfp |= __GFP_RETRY_MAYFAIL;
|
|
|
|
|
|
|
|
/* Whoever is interested in the event, pays for the allocation. */
|
|
/* Whoever is interested in the event, pays for the allocation. */
|
|
|
memalloc_use_memcg(group->memcg);
|
|
memalloc_use_memcg(group->memcg);
|