[PATCH v1 0/2] Fix KASAN support for KHO restored vmalloc regions

From: Pasha Tatashin

Date: Wed Feb 25 2026 - 17:03:11 EST


When KHO restores a vmalloc area, it maps existing physical pages into a
newly allocated virtual memory area. However, because these areas were not
properly unpoisoned, KASAN would treat any access to the restored region
as out-of-bounds, as seen in the following trace:

BUG: KASAN: vmalloc-out-of-bounds in kho_test_restore_data.isra.0+0x17b/0x2cd
Read of size 8 at addr ffffc90000025000 by task swapper/0/1
[...]
Call Trace:
[...]
kasan_report+0xe8/0x120
kho_test_restore_data.isra.0+0x17b/0x2cd
kho_test_init+0x15a/0x1f0
do_one_initcall+0xd5/0x4b0

The fix involves deferring KASAN's default poisoning by using the
VM_UNINITIALIZED flag during allocation, manually unpoisoning the
memory once it is correctly mapped, and then clearing the uninitialized
flag using a newly exported helper.

Pasha Tatashin (2):
mm/vmalloc: export clear_vm_uninitialized_flag()
kho: fix KASAN support for restored vmalloc regions

kernel/liveupdate/kexec_handover.c | 12 +++++++++++-
mm/internal.h | 2 ++
mm/vmalloc.c | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)

--
2.53.0.414.gf7e9f6c205-goog