]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 21 Aug 2020 07:15:25 +0000 (07:15 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 21 Aug 2020 13:30:25 +0000 (23:30 +1000)
commit5b6c486f7bddc9d53ebce7b8889ff79861c14f9c
tree1ce76f3c46a905b3d462db114bc30c2ccb157a20
parentf849bdbbb33cd79f849b5c8e0677b09b85c71ca1
powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000

In is_module_segment(), when VMALLOC_END is over 0xf0000000,
ALIGN(VMALLOC_END, SZ_256M) has value 0.

In that case, addr >= ALIGN(VMALLOC_END, SZ_256M) is always
true then is_module_segment() always returns false.

Use (ALIGN(VMALLOC_END, SZ_256M) - 1) which will have
value 0xffffffff and will be suitable for the comparison.

Fixes: 675b54f4f4ac ("powerpc/32s: Only leave NX unset on segments used for modules")
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/09fc73fe9c7423c6b4cf93f93df9bb0ed8eefab5.1597994047.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/book3s32/mmu.c