bytecodealliance / lucet

Lucet, the Sandboxing WebAssembly Compiler.
Apache License 2.0
4.07k stars 164 forks source link

Fix wake in `UffdRegion` for invalid page access on Linux 5.7+. #648

Closed peterhuene closed 3 years ago

peterhuene commented 3 years ago

On Linux 5.7+, the kernel retries faults which is causing the uffd tests to hang because the UffdRegion wakes invalid page accesses expecting the kernel to signal SIGBUS rather than retry the fault.

This fix attempts to work around the recent kernel behavior by changing the page protection to NONE for an invalid page access. The access is reset when the Alloc is dropped or when the instance is reset.

peterhuene commented 3 years ago

With these changes, the uffd tests now pass on my Ubuntu VM running kernel 5.8.0.