3 ms·
This was a fun write up. On the off chance the author is reading the comments here, there are a couple security features they need to add for it to be more com
by jlrubin 9y ago
This was a fun write up.
On the off chance the author is reading the comments here, there are a couple security features they need to add for it to be more complete (I'm probably missing some things).
1) They should add a call to access_ok(VERIFY_WRITE, pointer, mem::size_of<Syscall>()) in rust_syscall_handle to ensures that the user space pointer points to valid userspace memory of the right shape for the syscall type.
2) They should sanitize (hopefully, using some zero-cost method) the Syscall type to guarantee that it is well-formed before calling handle. If the userspace constructs some normally impossible to construct Syscall, it's unclear how a rust match pattern handles it (i.e., if an enum has only 3 types and you pass in a falsely constructed variant with tag 100 is match guaranteed not to just be using a jump table and accidentally jump 100 instructions?)
- masklinn 9y agoDon't know about HN but a friend of the author posted this on reddit and was commenting there: https://www.reddit.com/r/programming/comments/6f235k/rewrite_the_linux_kernel_in_rust/dif9prj/ https://www.reddit.com/r/programming/comments/6f235k/rewrite... edit: they also submitted it on HN, but it looks like they didn't get the "winning" submission: https://news.ycombinator.com/submitted?id=fjallidergodur https://news.ycombinator.com/submitted?id=fjallidergodur
- fjallidergodur 9y agoI am said friend, we're reading the discussion.