mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
restore the security check around recalculatesleep
This commit is contained in:
parent
bdc43a5190
commit
5815eae023
1 changed files with 5 additions and 1 deletions
|
|
@ -629,7 +629,11 @@ fn xmain() -> ! {
|
||||||
|
|
||||||
// If we're being asked to recalculate due to a timeout expiring, drop the sent
|
// If we're being asked to recalculate due to a timeout expiring, drop the sent
|
||||||
// message from the `entries` list.
|
// 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)
|
&& (sender > 0)
|
||||||
{
|
{
|
||||||
let entries = notify_hash
|
let entries = notify_hash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue