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

Paul Walmsley pjw at kernel.org
Wed May 13 18:20:21 PDT 2026


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?


thanks

- Paul



More information about the linux-riscv mailing list