Skip to content

Commit 7bee31a

Browse files
chleroympe
authored andcommitted
powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined
When MODULES_VADDR is defined, is_module_segment() shall check the address against it instead of checking agains VMALLOC_START. Fixes: 6ca0553 ("powerpc/32s: Use dedicated segment for modules with STRICT_KERNEL_RWX") Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/07884ed033c31e074747b7eb8eaa329d15db07ec.1596641219.git.christophe.leroy@csgroup.eu
1 parent 48d2f04 commit 7bee31a

File tree

1 file changed

+7
-0
lines changed
  • arch/powerpc/mm/book3s32

1 file changed

+7
-0
lines changed

arch/powerpc/mm/book3s32/mmu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,17 @@ static bool is_module_segment(unsigned long addr)
191191
{
192192
if (!IS_ENABLED(CONFIG_MODULES))
193193
return false;
194+
#ifdef MODULES_VADDR
195+
if (addr < ALIGN_DOWN(MODULES_VADDR, SZ_256M))
196+
return false;
197+
if (addr >= ALIGN(MODULES_END, SZ_256M))
198+
return false;
199+
#else
194200
if (addr < ALIGN_DOWN(VMALLOC_START, SZ_256M))
195201
return false;
196202
if (addr >= ALIGN(VMALLOC_END, SZ_256M))
197203
return false;
204+
#endif
198205
return true;
199206
}
200207

0 commit comments

Comments
 (0)