Why use a pipe to communicate instead of shared memory?
Show HN: I built a Rust crate for running unsafe code safely
41–50 of 72 posts
Re: Show HN: I built a Rust crate for running unsafe code safely
#42There is a way to sandbox native code without forking to a new process, and it looks like this https://hacks.mozilla.org/2020/02/securing-firefox-with-weba... Firefox employs processes for sandboxing but for small components they are not worth the overhead. For those they employed this curious idea: first compile the potentially unsafe code to wasm (any other VM would work), then compile the wasm code to C (using the…
-fsanitize=undefinedRe: Show HN: I built a Rust crate for running unsafe code safely
#43There is a way to sandbox native code without forking to a new process, and it looks like this https://hacks.mozilla.org/2020/02/securing-firefox-with-weba... Firefox employs processes for sandboxing but for small components they are not worth the overhead. For those they employed this curious idea: first compile the potentially unsafe code to wasm (any other VM would work), then compile the wasm code to C (using the…
You can skip all this nonsense with -fsanitize=undefined
Re: Show HN: I built a Rust crate for running unsafe code safely
#44There is a way to sandbox native code without forking to a new process, and it looks like this https://hacks.mozilla.org/2020/02/securing-firefox-with-weba... Firefox employs processes for sandboxing but for small components they are not worth the overhead. For those they employed this curious idea: first compile the potentially unsafe code to wasm (any other VM would work), then compile the wasm code to C (using the…
Re: Show HN: I built a Rust crate for running unsafe code safely
#45There is a way to sandbox native code without forking to a new process, and it looks like this https://hacks.mozilla.org/2020/02/securing-firefox-with-weba... Firefox employs processes for sandboxing but for small components they are not worth the overhead. For those they employed this curious idea: first compile the potentially unsafe code to wasm (any other VM would work), then compile the wasm code to C (using the…
You can skip all this nonsense with -fsanitize=undefined
Re: Show HN: I built a Rust crate for running unsafe code safely
#46[1] https://man7.org/linux/man-pages/man7/signal-safety.7.html
Re: Show HN: I built a Rust crate for running unsafe code safely
#47There is a way to sandbox native code without forking to a new process, and it looks like this https://hacks.mozilla.org/2020/02/securing-firefox-with-weba... Firefox employs processes for sandboxing but for small components they are not worth the overhead. For those they employed this curious idea: first compile the potentially unsafe code to wasm (any other VM would work), then compile the wasm code to C (using the…
Re: Show HN: I built a Rust crate for running unsafe code safely
#48As a joke, it's funny. Obviously you would not want to actually deploy this. I feel like most comments are too quick to criticize using this in prod (don't!) and missing the point.
Re: Show HN: I built a Rust crate for running unsafe code safely
#49Awesome work!
Re: Show HN: I built a Rust crate for running unsafe code safely
#50Earlier quoted context omitted.
Even better, this library, with its use of unsafe and fork underneath, introduces a whole new class of undefined behavior to a program by providing a safe interface over an unsafe API without actually enforcing the invariants necessary for safety. In order for the fork() it calls to be safe, it needs to guarantee a bunch of properties of the program that it simply cannot. If this gets used in a multithreaded program…
Yep. I wanted to start from the high-level point of "safe doesn't mean doesn't crash," but you're right that the technique itself is unsound.