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] Writing to the cache line of current executing instructions will crash the processor #2566

Open
1 task done
riscv914 opened this issue Oct 25, 2024 · 0 comments
Open
1 task done
Labels
Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@riscv914
Copy link

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Summary

A vulnerability in the CVA6 processor causes a crash if a cache line holding the currently executing instruction is modified. Specifically, if an adversary executes a store instruction targeting memory that shares a cache line with the executing instruction, the processor will fail.

Details

The issue arises due to a write-back operation during cache coherency, where writing back a dirty cache line puts the processor into a state that leads to a crash.

PoC

If the asm volatile("sw t0, 0(%0)") store instruction modifies a memory address within the same cache line (e.g., between 0x80001000 and 0x800011FF) as the executing instruction, the processor will crash. However, if the store instruction is directed to the next cache line (e.g., 0x80001200), the code executes normally.

volatile unsigned int *code_mem = (unsigned int *)0x800011FF;
asm volatile("li t0, 0x000000013");
asm volatile("sw t0, 0(%0)" : : "r"(code_mem));

Impact

This vulnerability causes undefined behavior in the processor, potentially leading to a denial of service (DoS).

@riscv914 riscv914 added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

1 participant