coconut-svsm / svsm

COCONUT-SVSM
MIT License
122 stars 42 forks source link

mm: various improvements to PageRef #450

Closed Freax13 closed 2 months ago

Freax13 commented 2 months ago

This PR fixes some soundness issues around PageRef and adds save abstractions for reading, writing, and filling a PageRef.

p4zuu commented 2 months ago

I think I don't fully understand why implementing PageRef::read()/write()/fill() in assembly fixes the soundness issue. It's just shortening the race window, right? Otherwise, looks good to me

Freax13 commented 2 months ago

I think I don't fully understand why implementing PageRef::read()/write()/fill() in assembly fixes the soundness issue. It's just shortening the race window, right? Otherwise, looks good to me

Data races are only UB if they happen through normal reads or writes. If we implement the reads/writes in assembly, data races aren't UB.