From c499087d5ab70417de779804810f792dd981c385 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 8 Feb 2026 12:49:50 +0800 Subject: [PATCH] remove redundant prints in loader the first check should *never* print a message because an attacker can trigger a glitch off of the UART. this eliminates the diagnostic print on the first check. --- loader/src/main.rs | 3 +-- loader/src/platform/bao1x/swap.rs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/loader/src/main.rs b/loader/src/main.rs index 21a8021f3..703c103e5 100644 --- a/loader/src/main.rs +++ b/loader/src/main.rs @@ -313,8 +313,7 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32) } bao1x_hal::sigcheck::die_no_std(); } else { - println!("{}LOADER.KERNDEV,{}", BOOKEND_START, BOOKEND_END); - println!("Developer key detected on kernel. Proceeding in developer mode!"); + // don't print anything on the first check, so a double-glitch is harder } } csprng.random_delay(); diff --git a/loader/src/platform/bao1x/swap.rs b/loader/src/platform/bao1x/swap.rs index a9b92ed13..100a41c7d 100644 --- a/loader/src/platform/bao1x/swap.rs +++ b/loader/src/platform/bao1x/swap.rs @@ -279,6 +279,12 @@ impl SwapHal { ); bao1x_hal::sigcheck::die_no_std(); } else { + bollard!(bao1x_hal::sigcheck::die_no_std, 4); + // check if it's still 0 - force a double-glitch + if owc.get(bao1x_api::DEVELOPER_MODE).unwrap() == 0 { + bao1x_hal::sigcheck::die_no_std(); + } + bollard!(bao1x_hal::sigcheck::die_no_std, 4); println!("{}LOADER.SWAPDEV,{}", BOOKEND_START, BOOKEND_END); println!( "Developer key detected on swap. Proceeding in developer mode!"