Merge changes I3f9fed0e,I44420fab,Ib847ee61 into main
* changes:
pvmfw: Update README.md to explain pvmfw-tool
pvmfw-tool: Make VM DTBO optional for building pvmfw
pvmfw-tool: Fix runtime crash
diff --git a/vmbase/src/entry.rs b/vmbase/src/entry.rs
index 2ff66cc..b19efce 100644
--- a/vmbase/src/entry.rs
+++ b/vmbase/src/entry.rs
@@ -53,8 +53,14 @@
// We keep a null byte at the top of the stack guard to act as a string terminator.
let random_guard = &mut stack_guard[..(SIZE_OF_STACK_GUARD - 1)];
- rand::init().expect("Failed to initialize a source of entropy");
- rand::fill_with_entropy(random_guard).expect("Failed to get stack canary entropy");
+ if let Err(e) = rand::init() {
+ panic!("Failed to initialize a source of entropy: {e}");
+ }
+
+ if let Err(e) = rand::fill_with_entropy(random_guard) {
+ panic!("Failed to get stack canary entropy: {e}");
+ }
+
bionic::__get_tls().stack_guard = u64::from_ne_bytes(stack_guard);
// Note: If rust_entry ever returned (which it shouldn't by being -> !), the compiler-injected