diff --git a/arch/loongarch/kernel/process.c b/arch/loongarch/kernel/process.c index f6c0bdb0238be74bc386f7fa6e58500da496a78a..92f336cbd51e4e4140bbd07ab04ec2fcce84946f 100644 --- a/arch/loongarch/kernel/process.c +++ b/arch/loongarch/kernel/process.c @@ -280,13 +280,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; }