MIPS: kernel: Fix random segmentation faults

Commit 69896119dc ("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: 69896119dc ("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>
This commit is contained in:
Thomas Bogendoerfer 2025-11-20 13:10:29 +01:00
parent 9f048fa487
commit 14b46ba92b
1 changed files with 1 additions and 1 deletions

View File

@ -692,7 +692,7 @@ unsigned long mips_stack_top(void)
/* Space for the VDSO, data page & GIC user page */ /* Space for the VDSO, data page & GIC user page */
if (current->thread.abi) { if (current->thread.abi) {
top -= PAGE_ALIGN(current->thread.abi->vdso->size); top -= PAGE_ALIGN(current->thread.abi->vdso->size);
top -= PAGE_SIZE; top -= VDSO_NR_PAGES * PAGE_SIZE;
top -= mips_gic_present() ? PAGE_SIZE : 0; top -= mips_gic_present() ? PAGE_SIZE : 0;
/* Space to randomize the VDSO base */ /* Space to randomize the VDSO base */