selinux: use GFP_NOWAIT in the AVC kmem_caches
authorMichal Hocko <mhocko@kernel.org>
Thu, 3 Aug 2017 08:11:52 +0000 (10:11 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 8 Aug 2017 13:12:23 +0000 (09:12 -0400)
commit476accbe2f6ef69caeebe99f52a286e12ac35aee
treefa8f78eebbc6c5657634751906db4d445359cce5
parentaf63f4193f9fbbbac50fc766417d74735afd87ef
selinux: use GFP_NOWAIT in the AVC kmem_caches

There is a strange __GFP_NOMEMALLOC usage pattern in SELinux,
specifically GFP_ATOMIC | __GFP_NOMEMALLOC which doesn't make much
sense.  GFP_ATOMIC on its own allows to access memory reserves while
__GFP_NOMEMALLOC dictates we cannot use memory reserves.  Replace this
with the much more sane GFP_NOWAIT in the AVC code as we can tolerate
memory allocation failures in that code.

Signed-off-by: Michal Hocko <mhocko@kernel.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/avc.c