1# SCP-Firmware Threat Model 2 3## Overview 4 5The SCP provides services to agents in the system. The agents might be the 6operating system or the PSCI agent running on the application processor. Other 7agents in the system could also generate requests for resources that the SCP 8controls directly. Examples of such agents might be a modem subsystem in a 9mobile SoC or a management function in a server SoC. The SCP reconciles requests 10from all agents, managing the availability of shared resources and power 11performance limits according to all constraints. The SCP has a minimum set of 12resources, including local private memory, timers,interrupt control, and 13registers for system configuration, control and status. 14 15In a system comprising multiple agents, one trusted agent typically has elevated 16privileges to configure and control the access rights of other agents in the 17system. PSCI agent generally is the trusted agent. The platform is responsible 18for securing the privileged agent. 19 20## Scope 21 22The SCP Firmware provides system SCMI agents like OSPM and PSCI control over 23hardware resources such as power domain gating, voltage supplies, clocks, 24sensors and counters. The scope of the threat model assets are the SCMI 25resources including devices and protocols. The trust boundary is between the 26SCMI Agents and the Firmware. 27 28## SCP-Firmware Data Flow Diagrams 29 30 31 32## Assumptions 33 34Agents send requests over a private transport channel. A typical channel is a 35shared memory or MHU. The transport channel is dedicated to a specific agent. 36An agent should not be able to access another agent's channel. 37Such privacy is enforced by an external entity such as the operating system, 38trusted firmware or the hardware. The SCP-Firmware cannot enforce or determine a 39violation of this rule. 40 41## Resource Permissions: 42 43In a system with multiple agents, the SCMI protocol provides commands that allow 44a trusted agent to configure the access permissions of other agents. An agent 45should not be able to discover resources and commands it cannot access. 46Only trusted agents can access the Base Protocol commands to configure 47agent-specific permissions. The PSCI agent is the only trusted agent in the 48system, and it's the only agent that can configure resource permissions. 49 50## SCP-Firmware STRIDE Threat Analysis 51 52### Spoofing: 53 54According to the SCMI specification, each agent is identified by its dedicated 55transport channel via the SCP. It is important to note that the protection of 56the security and integrity of the channel is not included in the scope of SCP 57Firmware. Therefore, this threat is not considered by the SCP threat model. 58 59### Tampering: 60 61The threat model assumes that hardware means protecting against tampering. Each 62agent has a dedicated transport channel which another agent cannot and should 63not access. Also, internal SCP registers and memory are not accessible by 64external agents. 65 66### Repudiation: 67 68This threat is more applicable to systems where the history of commands sent by 69an agent is essential and saved in a log buffer. For example, if an agent sends 70a command, then denies this fact. This threat is not relevant or considered a 71threat to SCP-Firmware. 72 73### Denial of Service: 74 75Agents send requests over a transport channel. A typical channel is MHU doorbell 76or fastchannel. These channels are dedicated to a specific agent. Although an 77attacker agent can't access another agent channel, continuously sending requests 78will likely keep the SCP busy and starve the other agents, resulting in a denial 79of service. Another possible scenario is when an attacker agent repeatedly sends 80requests faster than the SCP can dequeue and process. This situation will fill 81the queue and result in a denial of service. 82 83The SCP should protect against flood attacks, which makes it unavailable to 84legitimate agents. 85 86### Information Disclosure: 87 88The SCP should protect against disclosing sensitive sensor data using device 89resource permissions. Access to all counter data is not allowed. SMCF should not 90be externally accessible. 91 92### Elevation of Privilege: 93 94The SCP should not allow an OSPM or MCP agent to change the state of a core 95power domain. Only a PSCI agent is authorized. 96 97An SCMI agent should not be able to access or modify the permissions of a 98protocol, command or device if it is not permitted to do so. Only a trusted 99agent should be able to modify access permissions of Secure or Root platform 100resources. A non-trusted agent cannot change Root or Secure platform resource 101access permissions. 102 103## Software security requirements 104 105| ID | Asset | Attacker | Attack type | Attack description | 106| --- | :---: | :------: | :----------------: | :--------- | 107| 01 | A01 | TA01 TA03 | E | Only PSCI Agent is allowed to modify the core power domain state | 108| 02 | A01 A02 A03 A04 | TA01 TA03 | E | An SCMI protocol should only be accessible to agents with the correct SCMI permissions | 109| 03 | A01 A02 A03 A04 | TA01 TA03 | E | An SCMI command should only be accessible to agents with the correct SCMI permissions | 110| 04 | A01 A02 A03 A04 | TA01 TA03 | E | A device should only be accessible to agents with the correct SCMI permissions | 111| 05 | A05 | TA01 TA03 | E | Only trusted agents are authorized to modify resource permissions | 112| 06 | A01 A02 A03 A04 | TA01 TA02 TA03 | D | It is important to prevent any attempt by agents to flood attack the SCP-Firmware, as this could lead to the starvation of other agents | 113| 07 | A03 | TA01 TA02 TA03 | I | It is essential to ensure that agents do not have access to sensitive sensor data or counters | 114 115 116## Software security mitigations 117 118| ID | Asset | Attacker | mitigation description | 119| --- | :---: | :------: | :--------- | 120| 01 | A01 | TA01 TA03 | The SCMI power domain module should only accept the set state command from the PSCI agent | 121| 02 | A01 A02 A03 A04 | TA01 TA03 | The SCMI resource permissions module should reject requests to a specific protocol if the agent is not authorized to use it | 122| 03 | A01 A02 A03 A04 | TA01 TA03 | The SCMI resource permissions module should reject requests to a specific command for a particular agent if the agent is not allowed to use this command | 123| 04 | A01 A02 A03 A04 | TA01 TA03 |The SCMI resource permissions module should reject requests to a specific device if the agent is not authorized to access this device | 124| 05 | A05 | TA01 TA03 | The SCMI resource permissions module should reject requests to modify access permissions if the agent is not trusted | 125| 06 | A01 A02 A03 A04 | TA01 TA02 TA03 | The SCMI module should service requests from agents in a round-robin fashion to avoid starving other agents | 126| 07 | A03 | TA01 TA02 TA03 | Platform configuration should not include sensitive sensors and counters in the SCMI list of devices exposed to agents | 127