keystone-enclave / riscv-pk

Security monitor for Keystone Enclave (mirror of riscv-pk). Will be deprecated when openSBI port is ready
Other
36 stars 14 forks source link

Machine Time Interrupts for Enclaves #53

Closed ghost closed 4 years ago

ghost commented 4 years ago

We now handle timer interrupts in the SM. An enclave can cause a DDOS attack on other enclaves/SM if it doesn't yield the CPU. Not delegating time interrupts to S-mode prevents this. SM now handles time interrupts. Before an enclave runs, the SM sets a timer interrupt with some time slice, the max QUANTA the enclave should run. If the enclave lives to this QUANTA without yielding the CPU, the enclave will receive a machine timer interrupt which isn't delegated to the enclave and the SM will have to step in.