Skip to content

Commit 314b781

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: kasan: Fix MODULES_VADDR evaluation due to local variables' name
commit 2bfc6cd ("riscv: Move kernel mapping outside of linear mapping") makes use of MODULES_VADDR to populate kernel, BPF, modules mapping. Currently, MODULES_VADDR is defined as below for RV64: | #define MODULES_VADDR (PFN_ALIGN((unsigned long)&_end) - SZ_2G) But kasan_init() has two local variables which are also named as _start, _end, so MODULES_VADDR is evaluated with the local variable _end rather than the global "_end" as we expected. Fix this issue by renaming the two local variables. Fixes: 2bfc6cd ("riscv: Move kernel mapping outside of linear mapping") Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 01f5315 commit 314b781

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/riscv/mm/kasan_init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void __init kasan_shallow_populate(void *start, void *end)
169169

170170
void __init kasan_init(void)
171171
{
172-
phys_addr_t _start, _end;
172+
phys_addr_t p_start, p_end;
173173
u64 i;
174174

175175
/*
@@ -189,9 +189,9 @@ void __init kasan_init(void)
189189
(void *)kasan_mem_to_shadow((void *)VMALLOC_END));
190190

191191
/* Populate the linear mapping */
192-
for_each_mem_range(i, &_start, &_end) {
193-
void *start = (void *)__va(_start);
194-
void *end = (void *)__va(_end);
192+
for_each_mem_range(i, &p_start, &p_end) {
193+
void *start = (void *)__va(p_start);
194+
void *end = (void *)__va(p_end);
195195

196196
if (start >= end)
197197
break;

0 commit comments

Comments
 (0)