bytecodealliance / lucet

Lucet, the Sandboxing WebAssembly Compiler.
Apache License 2.0
4.06k stars 165 forks source link

Fixes #452: Introduce a random slot allocation strategy to the Region. #496

Closed fst-crenshaw closed 4 years ago

fst-crenshaw commented 4 years ago

This PR does two things:

  1. Stays up to date with improvements over in https://github.com/bytecodealliance/lucet/pull/494 in which @acfoltzer refactored validate_runtime_spec() to be more accommodating.

  2. Introduces an AllocStrategy for the Region. When creating a new instance in a Region, one can choose to allocate the new instance using the original strategy (give me the next one you got) or randomly from the set of available slots.

See original issue over at: https://github.com/bytecodealliance/lucet/issues/452

jedisct1 commented 4 years ago

Looks great!

And this is a nice improvement, thanks!

fst-crenshaw commented 4 years ago

I believe I have a code-complete first draft of this work. Reviews are appreciated as your input will go towards improving it.

fst-crenshaw commented 4 years ago

Thanks @jedisct1. You make a great point about secure defaults. I'd love to make Random the default strategy, but I'd like to do some integration testing in a few places first. I'd also like to submit the "Random is a Default" work as a separate stand-alone PR; it would be one of those big fiddly PRs where a whole bunch of tests would need to be slightly altered and not much else happens.

jedisct1 commented 4 years ago

Makes sense! Thanks Tanya!