News for hackers. Stuff that matters.
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by bitexploder on Thursday October 17, 2024 @08:28AM (#41869017)
And a VMM is going to require a lot of unsafe rust code. There are strategies to minimize it to make that surface easier to audit, but it is not a panacea for systems programming gremlins.
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by nicce on Thursday October 17, 2024 @09:08AM (#41869321)
It is manager, not runner. Does it require that much unsafe?
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by gpm on Thursday October 17, 2024 @10:58AM (#41870291)
Out of 413,842 non-empty lines of rust code in the repository (including comments) there are 2006 instances of "unsafe", 255 of which are of the form "unsafe_" (definitely not unsafe blocks, mostly of the form #![forbid(unsafe_code)] which is an instruction to the linter to forbid unsafe blocks in the module) leaving slightly less than 1751 unsafe blocks. (Still counting comments, and type signature annotations on function pointers, and so on, but most of those 1751 will be actual unsafe blocks. A block can of course be multiple lines of code).

I don't really know what a VMM consists of, so I'm mostly surprised that this project is half a million lines of code.

Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by estebank on Thursday October 17, 2024 @12:08PM (#41870957)
For this kind of analysis, https://github.com/geiger-rs/cargo-geiger comes in handy.
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by gpm on Thursday October 17, 2024 @12:30PM (#41871160)
Yeah, I tried that before resorting to just using `rg`, unfortunately this issue prevents it from working: https://github.com/geiger-rs/cargo-geiger/issues/523
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by sirwhinesalot on Thursday October 17, 2024 @08:51AM (#41869197)
No question, just pointing out where the *perceived* trustworthiness comes from. If it helps for something like a VMM it's a whole other story. Marketing gimmick.
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by monocasa on Thursday October 17, 2024 @08:53AM (#41869220)
A paravisor actually doesn't really need that much.
Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by Ygg2 on Thursday October 17, 2024 @09:30AM (#41869496)
It's not unsafe that causes unsafety, it's how you wield it.

- Do you know your invariants?

- Have you documented them?

- If using unsafe block, have you asserted them or guaranteed that they hold for any input?

Granted, Rust is kind of mediocre at teaching you this. It raises warning for unsafe fn without safety documentation block, but not when omittin safety comments in unsafe blocks.

Re:OpenVMM – A New VMM for Windows and Linux, Written in Rust by gpm on Thursday October 17, 2024 @11:08AM (#41870384)
For what it's worth, clippy has an optional lint to detect undocumented unsafe blocks: https://rust-lang.github.io/rust-clippy/master/index.html#un...