Repository navigation
Add xtest for RISC-V Zicfilp landing-pad user mode enforcement - #864
Open
raymo200915 wants to merge 3 commits into
Open
raymo200915 wants to merge 3 commits into
raymo200915 wants to merge 3 commits into
Conversation
Add RISC-V-only xtest coverage for Zicfilp landing pads. A protected TA verifies a compiler-generated indirect call and checks that a jump to a hand-written non-LPAD target terminates only the offending TA. Exercise the same fault before the TA uses the FPU, verify that OP-TEE continues to service a new TA after the fault, and verify the two loading policies: an unmarked main TA runs unguarded while a protected TA rejects an unmarked shared library loaded with dlopen(). Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Alternate between a protected TA and an unmarked TA while keeping the unmarked TA session open. Check that a non-LPAD target succeeds in the unmarked TA and still faults in the protected TA after each switch. Repeat the sequence with a new protected TA after each expected fault to exercise restoration of the landing-pad enforcement state. Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Check landing-pad enforcement after calls between protected and unmarked TAs in both directions. Verify that the caller retains its own policy after the callee returns. Exercise the same policies after TEE_Wait(), which suspends and resumes the secure thread through RPC. Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series adds xtest 1049 to exercise RISC-V Zicfilp landing-pad enforcement in user mode. It uses a guarded TA, an unmarked TA and an unmarked shared library to verify that OP-TEE applies the expected policy to each TA. The test components are selected for RV64 TA builds with
CFG_TA_ZICFILP=y.The three commits cover:
Indirect branches and loading policy. A compiler-generated indirect call to a valid landing pad succeeds. An indirect jump to a target without a landing pad terminates the guarded TA, including when the TA has not used the FPU. OP-TEE can then open a fresh session. The same kind of jump succeeds in the unmarked TA, while the guarded TA rejects the unmarked library through
dlopen().TA context switches. The test keeps an unmarked TA session open and alternates between it and fresh guarded TA sessions. After each switch, it verifies that the unmarked TA can still call its target and that the guarded TA still faults on a missing landing pad.
TA-to-TA calls and RPC. The test exercises calls in both directions between guarded and unmarked TAs. It verifies the caller’s landing-pad policy after the callee returns and after
TEE_Wait()suspends and resumes the caller through RPC.xtest 1049 passed on QEMU RV64 with both GCC and LLVM, using the companion optee_os Zicfilp series (OP-TEE/optee_os#8328) with
CFG_CORE_ZICFILP=yandCFG_TA_ZICFILP=y.Running environment: QEMU 10.1.93, built using GCC 15.3.0 with GNU Binutils 2.45.1, or LLVM/Clang 22.1.8.