diff --git a/arch/loongarch/kernel/process.c b/arch/loongarch/kernel/process.c index 95a124058e32ee350393ac51e8a93aab444981ee..b50087a2c55dd45f3e3228bedd6c564785188bad 100644 --- a/arch/loongarch/kernel/process.c +++ b/arch/loongarch/kernel/process.c @@ -273,13 +273,15 @@ unsigned long stack_top(void) { unsigned long top = TASK_SIZE & PAGE_MASK; + if (current->thread.vdso) { /* Space for the VDSO & data page */ top -= PAGE_ALIGN(current->thread.vdso->size); top -= PAGE_SIZE; /* Space to randomize the VDSO base */ if (current->flags & PF_RANDOMIZE) - top -= VDSO_RANDOMIZE_SIZE; + top -= VDSO_RANDOMIZE_SIZE; + } return top; }