]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kmsan: remove hard-coded GFP_KERNEL flags
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Tue, 7 Oct 2025 12:20:32 +0000 (14:20 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Nov 2025 01:27:54 +0000 (17:27 -0800)
commitb186a94227b753f2fdcab0df29dfc636c63ac329
tree536cafa9ef5c71c28e872b3915ca48bea3b6d47e
parentad435e79f8f5d6a5dae8ec122b14802d810defbf
kmsan: remove hard-coded GFP_KERNEL flags

kmsan_vmap_pages_range_noflush() allocates its temp s_pages/o_pages arrays
with GFP_KERNEL, which may sleep.  This is inconsistent with vmalloc() as
it will support non-blocking requests later.

Plumb gfp_mask through the kmsan_vmap_pages_range_noflush(), so it can use
it internally for its demand.

Please note, the subsequent __vmap_pages_range_noflush() still uses
GFP_KERNEL and can sleep.  If a caller runs under reclaim constraints,
sleeping is forbidden, it must establish the appropriate memalloc scope
API.

Link: https://lkml.kernel.org/r/20251007122035.56347-8-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kmsan.h
mm/internal.h
mm/kmsan/shadow.c
mm/percpu-vm.c
mm/vmalloc.c