Mark CLINT as reserved device on RISC-V platforms

Without this patch, user-level programs have the ability to
map in the core-local interrupt controller on RISC-V platforms
which contains the memory-mapped registers for the core-local
timer the kernel uses. This is a level of privilege that
user-level programs should not have. Writing to the `mtime`
register is possible which can then affect the timer interrupts
are delivered to the kernel.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
This commit is contained in:
Ivan-Velickovic
2023-06-09 22:13:42 +10:00
committed by Gerwin Klein
parent 625fb14e9b
commit 2730e65796
11 changed files with 126 additions and 8 deletions

View File

@@ -208,6 +208,17 @@ devices:
kernel: PLIC_PPTR
kernel_size: 0x04000000
# SiFive CLINT (HiFive, Polarfire, Ariane, QEMU RISC-V virt, Spike)
# Note that not all CLINTs with this compatible string are of the same size.
# However, omitting the kernel_size field works as each kernel device frame
# is of size 0x200000, which is currently larger than the CLINT's of all
# supported platforms.
- compatible:
- riscv,cpu-intc
regions:
- index: 0
kernel: CLINT_PPTR
# elfloader rules
- compatible:
- arm,psci-0.2