[PATCH v2] riscv: cif: reduce shadow stack size limit from 4GB to 2GB

Zong Li zong.li at sifive.com
Wed May 13 20:22:31 PDT 2026


On Thu, May 14, 2026 at 9:20 AM Paul Walmsley <pjw at kernel.org> wrote:
>
> Hi,
>
> On Mon, 27 Apr 2026, Zong Li wrote:
>
> > Follow the ARM64 GCS (Guarded Control Stack) implementation approach
> > by reducing the shadow stack size allocation from min(RLIMIT_STACK, 4GB)
> > to min(RLIMIT_STACK/2, 2GB). see commit '506496bcbb42 "arm64/gcs: Ensure
> > that new threads have a GCS")'
>
> Sashiko caught that this patch doesn't exactly follow the ARM
> implementation, in that it doesn't include the max(PAGE_SIZE, size)
> constraint, which covers the case where someone sets RLIMIT_STACK to
> something absurdly small ( < PAGE_SIZE ).  Care to fix that and post a new
> version?
>

Ok. I will send the next version to include that. Thanks for pointing it out.

>
> thanks
>
> - Paul



More information about the linux-riscv mailing list