In the Linux kernel, the following vulnerability has been resolved: mm/vmalloc, mm/kasan: respect gfp mask in kasanpopulatevmalloc() kasanpopulatevmalloc() and its helpers ignore the caller's gfpmask and always allocate memory using the hardcoded GFPKERNEL flag. This makes them inconsistent with vmalloc(), which was recently extended to support GFPNOFS and GFPNOIO allocations. Page table allocations performed during shadow population also ignore the external gfpmask. To preserve the intended semantics of GFPNOFS and GFPNOIO, wrap the applytopagerange() calls into the appropriate memalloc scope. xfs calls vmalloc with GFPNOFS, so this bug could lead to deadlock. There was a report here https://lkml.kernel.org/r/686ea951.050a0220.385921.0016.GAE@google.com This patch: - Extends kasanpopulatevmalloc() and helpers to take gfpmask; - Passes gfpmask down to allocpagesbulk() and _getfreepage(); - Enforces GFPNOFS/NOIO semantics with memalloc*save()/restore() around applytopagerange(); - Updates vmalloc.c and percpu allocator call sites accordingly.