[PW_SID:1085048] riscv: cif: reduce shadow stack size limit from 4GB to 2GB#1811
[PW_SID:1085048] riscv: cif: reduce shadow stack size limit from 4GB to 2GB#1811linux-riscv-bot wants to merge 2 commits into
Conversation
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")' Rationale: 1. Shadow stacks only store return addresses (8 bytes per entry), not local variables, function parameters, or saved registers. A 2GB shadow stack is far more than sufficient for any practical application, even with extremely deep recursion. Using half the size maintains adequate while being more resource-efficient margin 2. On memory-constrained systems (e.g., platforms with only 4GB of physical memory, which is a common configuration), allocating 4GB of virtual address space for shadow stack per process/thread can lead to virtual memory allocation failures when the overcommit mode is set to OVERCOMMIT_GUESS or OVERCOMMIT_NEVER: Error: "__vm_enough_memory: not enough memory for the allocation" This reduces virtual address space consumption by 50% while maintaining more than adequate space for return address storage. Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
|
Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB" |
506e7f6 to
01805bc
Compare
PR for series 1085048 applied to workflow__riscv__fixes
Name: riscv: cif: reduce shadow stack size limit from 4GB to 2GB
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1085048
Version: 1