starfive-tech / opensbi

Other
17 stars 17 forks source link

[CRITICAL] Protect opensbi memory ranges in uncached DDR region #8

Open ganboing opened 2 years ago

ganboing commented 2 years ago

visionfive v1 has DDR memory mapped twice -- one in cached region (32GB@0x80000000) and the other in uncached region (32GB@0x1000000000). opensbi only has the pmp setup for cached region, leaving the uncached region unprotected. S mode can just modify opensbi through 0x1000000000, and effectively renders risc-v pmp useless.