diff --git a/services/ticktimer-server/src/main.rs b/services/ticktimer-server/src/main.rs index e41d68ade..ed15b5c00 100644 --- a/services/ticktimer-server/src/main.rs +++ b/services/ticktimer-server/src/main.rs @@ -629,7 +629,11 @@ fn xmain() -> ! { // If we're being asked to recalculate due to a timeout expiring, drop the sent // message from the `entries` list. - if (request_kind == RequestKind::Timeout as usize) + // the first check confirms that the origin of the RecalculateSleep message is the Ticktimer, + // to prevent third-party servers from issuing the command and thus distorting the sleep + // calculations (since this is a public API, anything could happen). + if (msg.sender.pid().map(|p| p.get()).unwrap_or_default() as u32) == xous::process::id() + && (request_kind == RequestKind::Timeout as usize) && (sender > 0) { let entries = notify_hash