Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cross-privilege TLB leakage through SLS #2732

Open
1 task done
TobiasKovats opened this issue Jan 23, 2025 · 0 comments
Open
1 task done

[BUG] Cross-privilege TLB leakage through SLS #2732

TobiasKovats opened this issue Jan 23, 2025 · 0 comments
Labels
notCV32A65X It is not an CV32A65X issue Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@TobiasKovats
Copy link

TobiasKovats commented Jan 23, 2025

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Hi!

Our microarchitectural fuzzer has found that CVA6 is susceptible to SLS (straight-line speculation [1]) and thus allows leakage through the TLB across privileges. Since speculatively issued loads and stores from a higher privilege access the TLB, their addresses can be recovered from a lower privilege. Thus, privileged code that (architecturally) does not leak any sensitive data through its control flow or memory operations, leaks transiently to an unprivileged attacker.

We provide a snippet from the generated test case bellow:

...
0xffffffd8200a244c lw      s2, 456(ra) # load some privileged data from S-mode
...
0xffffffd8200a2dd8 sret   # SPP=1, so we remain in S-mode
0xffffffd8200a2ddc sb      t0,-1338(a0)  # the store is executed transiently before we go to SEPC, and privileged data in a0 is used to access the TLB before the store is killed.
...
0xffffffd8200d0f50 sret # SPP=0, so we go to U-mode. The TLB is not flushed.
...
0xffffffd820067b50 sh      t0, -754(t2) # a store now leaks from the TLB.
...

We provide the ELF of the leaking test below, which can be executed using the setup of Cascade.

testcase.tar.gz

[1] https://developer.arm.com/documentation/102825/latest/

@TobiasKovats TobiasKovats added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Jan 23, 2025
@TobiasKovats TobiasKovats changed the title [BUG] <Cross-privilege TLB leakage> [BUG] Cross-privilege TLB leakage Jan 23, 2025
@JeanRochCoulon JeanRochCoulon added the notCV32A65X It is not an CV32A65X issue label Jan 23, 2025
@TobiasKovats TobiasKovats changed the title [BUG] Cross-privilege TLB leakage [BUG] Cross-privilege TLB leakage through SLS Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notCV32A65X It is not an CV32A65X issue Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

2 participants