History

riscv: kasan: Fix MODULES_VADDR evaluation due to local variables' name

commit 2bfc6cd81bd1 ("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.

Jisheng Zhang committed 5 years ago

Commit 314b7811 parent 01f53151 file · +4 −4Browse files

Unified · Split

arch/riscv/mm/kasan_init.c+4−4
@@ -169,7 +169,7 @@ static void __init kasan_shallow_populate(void *start, void *end) · 168 unmodified lines
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) · 13 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t