From 8a2118b8f656f14c6fbb605027eeb676859564ce Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 9 Feb 2026 02:17:31 +0800 Subject: [PATCH] fix bug in root-keys that prevents bbram provisionig from happening this bug highlights a fairly big weakness in the rkyv-based serialization in that there is no inherent type checking of the sender to the receiver. In this case, a typo of just one character lead to a regression which, probably in an earlier version of rkyv, was not a problem because the ordering of elements was different. In this case it lead to incorrect behavior, which upon debugging lead to panics because we were interpreting the data incorrectly after it was unpacked. This is probably an issue to be worried about in the longer-term, and it leaves me with a lingering question of what attack surface exists through the deserialization mechanism for attackers who send malformed buffers as messages. --- services/root-keys/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/root-keys/src/main.rs b/services/root-keys/src/main.rs index 29b141682..5733a9b0a 100644 --- a/services/root-keys/src/main.rs +++ b/services/root-keys/src/main.rs @@ -1626,10 +1626,10 @@ fn main() -> ! { } Some(Opcode::UxBbramCheckReturn) => { let buf = unsafe { Buffer::from_memory_message(msg.body.memory_message().unwrap()) }; - let console_text = buf.to_original::().unwrap(); - log::info!("got console text:{}", console_text.first().as_str()); - if console_text.first().as_str().starts_with("HELPER_OK") { - log::info!("got '{}', moving on", console_text.first().as_str()); + let console_text = buf.to_original::().unwrap(); + log::info!("got console text:{}", console_text.as_str()); + if console_text.as_str().starts_with("HELPER_OK") { + log::info!("got '{}', moving on", console_text.as_str()); // proceed if keys.is_pcache_update_password_valid() || !keys.is_initialized() { send_message(