Skip to content

[PW_SID:1081061] [v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY#1765

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1081061
Closed

[PW_SID:1081061] [v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY#1765
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1081061

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1081061 applied to workflow__riscv__fixes

Name: [v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1081061
Version: 2

Implement arch_within_stack_frames() to enable precise per-frame stack
object validation for CONFIG_HARDENED_USERCOPY on RISC-V.

Per the RISC-V ELF psABI Frame Pointer Convention [1], with
-fno-omit-frame-pointer (implied by CONFIG_FRAME_POINTER), the RISC-V
ABI places the saved frame pointer (fp/s0) and return address (ra) at
the top of each frame:

  high addr
    +------------------+  <--- fp (s0) -- frame pointer register
    |   saved ra       |      fp - 1*sizeof(void*) (return address)
    |   saved fp       |      fp - 2*sizeof(void*) (caller's frame pointer)
    +------------------+
    |   local variables|
    |   spilled args   |
    +------------------+  <--- sp
  low addr

The allowed usercopy region within one frame is
[prev_fp, fp-2*sizeof(void*)), covering local variables but excluding
the saved fp/ra slots.

The frame chain is walked from __builtin_frame_address(0), with prev_fp
initialized to current_stack_pointer rather than the thread stack base.
This ensures objects in already-returned frames are correctly detected
as BAD_STACK, since no live frame will cover that region.

[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#frame-pointer-convention

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 135.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2163.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2944.07 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.12 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.02 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.58 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
kdoc
Desc: Detects for kdoc errors
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
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: "[v2] riscv: mm: Implement arch_within_stack_frames() for HARDENED_USERCOPY"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1081061 branch April 22, 2026 00:05
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