Skip to content

Commit 55123af

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: kasan: remove !KASAN_VMALLOC remnants
Historically, KASAN could be selected with or without KASAN_VMALLOC, but since commit: f6f37d9 ("arm64: select KASAN_VMALLOC for SW/HW_TAGS modes") ... we can never select KASAN without KASAN_VMALLOC on arm64, and thus arm64 code for KASAN && !KASAN_VMALLOC is redundant and can be removed. Remove the redundant code kasan_init.c Signed-off-by: Mark Rutland <[email protected]> Reviewed-by: Alexander Potapenko <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Will Deacon <[email protected]> Tested-by: Shanker Donthineni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 8339f7d commit 55123af

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

arch/arm64/mm/kasan_init.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static void __init clear_pgds(unsigned long start,
214214
static void __init kasan_init_shadow(void)
215215
{
216216
u64 kimg_shadow_start, kimg_shadow_end;
217-
u64 mod_shadow_start, mod_shadow_end;
217+
u64 mod_shadow_start;
218218
u64 vmalloc_shadow_end;
219219
phys_addr_t pa_start, pa_end;
220220
u64 i;
@@ -223,7 +223,6 @@ static void __init kasan_init_shadow(void)
223223
kimg_shadow_end = PAGE_ALIGN((u64)kasan_mem_to_shadow(KERNEL_END));
224224

225225
mod_shadow_start = (u64)kasan_mem_to_shadow((void *)MODULES_VADDR);
226-
mod_shadow_end = (u64)kasan_mem_to_shadow((void *)MODULES_END);
227226

228227
vmalloc_shadow_end = (u64)kasan_mem_to_shadow((void *)VMALLOC_END);
229228

@@ -246,17 +245,9 @@ static void __init kasan_init_shadow(void)
246245
kasan_populate_early_shadow(kasan_mem_to_shadow((void *)PAGE_END),
247246
(void *)mod_shadow_start);
248247

249-
if (IS_ENABLED(CONFIG_KASAN_VMALLOC)) {
250-
BUILD_BUG_ON(VMALLOC_START != MODULES_END);
251-
kasan_populate_early_shadow((void *)vmalloc_shadow_end,
252-
(void *)KASAN_SHADOW_END);
253-
} else {
254-
kasan_populate_early_shadow((void *)kimg_shadow_end,
255-
(void *)KASAN_SHADOW_END);
256-
if (kimg_shadow_start > mod_shadow_end)
257-
kasan_populate_early_shadow((void *)mod_shadow_end,
258-
(void *)kimg_shadow_start);
259-
}
248+
BUILD_BUG_ON(VMALLOC_START != MODULES_END);
249+
kasan_populate_early_shadow((void *)vmalloc_shadow_end,
250+
(void *)KASAN_SHADOW_END);
260251

261252
for_each_mem_range(i, &pa_start, &pa_end) {
262253
void *start = (void *)__phys_to_virt(pa_start);

0 commit comments

Comments
 (0)