Skip to content

Commit 14b46ba

Browse files
committed
MIPS: kernel: Fix random segmentation faults
Commit 6989611 ("MIPS: vdso: Switch to generic storage implementation") switches to a generic vdso storage, which increases the number of data pages from 1 to 4. But there is only one page reserved, which causes segementation faults depending where the VDSO area is randomized to. To fix this use the same size of reservation and allocation of the VDSO data pages. Fixes: 6989611 ("MIPS: vdso: Switch to generic storage implementation") Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 9f048fa commit 14b46ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ unsigned long mips_stack_top(void)
692692
/* Space for the VDSO, data page & GIC user page */
693693
if (current->thread.abi) {
694694
top -= PAGE_ALIGN(current->thread.abi->vdso->size);
695-
top -= PAGE_SIZE;
695+
top -= VDSO_NR_PAGES * PAGE_SIZE;
696696
top -= mips_gic_present() ? PAGE_SIZE : 0;
697697

698698
/* Space to randomize the VDSO base */

0 commit comments

Comments
 (0)