Skip to content

[PW_SID:1085048] riscv: cif: reduce shadow stack size limit from 4GB to 2GB#1811

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1085048
Closed

[PW_SID:1085048] riscv: cif: reduce shadow stack size limit from 4GB to 2GB#1811
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1085048

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

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

Linux RISC-V bot and others added 2 commits April 5, 2026 01:35
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>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 115.36 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1019.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1357.44 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 74.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cif: reduce shadow stack size limit from 4GB to 2GB"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 506e7f6 to 01805bc Compare April 24, 2026 14:53
@linux-riscv-bot linux-riscv-bot deleted the pw1085048 branch April 28, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants