blob: 4db4c66a2d184b1b7619a7e23581c7a961f3004b [file] [log] [blame]
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02001SPMC threat model
2*****************
3
4************************
5Introduction
6************************
7This document provides a threat model for the TF-A `Secure Partition Manager`_
8(SPM) implementation or more generally the S-EL2 reference firmware running on
9systems implementing the FEAT_SEL2 (formerly Armv8.4 Secure EL2) architecture
10extension. The SPM implementation is based on the `Arm Firmware Framework for
Olivier Deprez2b0be752021-09-01 10:25:21 +020011Arm A-profile`_ specification.
Olivier Deprez86d1ffd2021-06-01 15:37:16 +020012
13In brief, the broad FF-A specification and S-EL2 firmware implementation
14provide:
15
16- Isolation of mutually mistrusting SW components, or endpoints in the FF-A
17 terminology.
18- Distinct sandboxes in the secure world called secure partitions. This permits
19 isolation of services from multiple vendors.
20- A standard protocol for communication and memory sharing between FF-A
21 endpoints.
22- Mutual isolation of the normal world and the secure world (e.g. a Trusted OS
23 is prevented to map an arbitrary NS physical memory region such as the kernel
24 or the Hypervisor).
25
26************************
27Target of Evaluation
28************************
29In this threat model, the target of evaluation is the S-EL2 firmware or the
30``Secure Partition Manager Core`` component (SPMC).
31The monitor and SPMD at EL3 are covered by the `Generic TF-A threat model`_.
32
33The scope for this threat model is:
34
35- The TF-A implementation for the S-EL2 SPMC based on the Hafnium hypervisor
36 running in the secure world of TrustZone (at S-EL2 exception level).
37 The threat model is not related to the normal world Hypervisor or VMs.
38 The S-EL1 SPMC solution is not covered.
J-Alvesfce56802021-11-11 17:23:53 +000039- The implementation complies with the FF-A v1.0 specification, and a few
40 features of FF-A v1.1 specification.
Olivier Deprez86d1ffd2021-06-01 15:37:16 +020041- Secure partitions are statically provisioned at boot time.
42- Focus on the run-time part of the life-cycle (no specific emphasis on boot
43 time, factory firmware provisioning, firmware udpate etc.)
44- Not covering advanced or invasive physical attacks such as decapsulation,
45 FIB etc.
46- Assumes secure boot or in particular TF-A trusted boot (TBBR or dual CoT) is
47 enabled. An attacker cannot boot arbitrary images that are not approved by the
48 SiP or platform providers.
49
50Data Flow Diagram
51======================
52Figure 1 shows a high-level data flow diagram for the SPM split into an SPMD
53component at EL3 and an SPMC component at S-EL2. The SPMD mostly acts as a
54relayer/pass-through between the normal world and the secure world. It is
55assumed to expose small attack surface.
56
57A description of each diagram element is given in Table 1. In the diagram, the
58red broken lines indicate trust boundaries.
59
60Components outside of the broken lines are considered untrusted.
61
62.. uml:: ../resources/diagrams/plantuml/spm_dfd.puml
63 :caption: Figure 1: SPMC Data Flow Diagram
64
65.. table:: Table 1: SPMC Data Flow Diagram Description
66
67 +---------------------+--------------------------------------------------------+
68 | Diagram Element | Description |
69 +=====================+========================================================+
70 | ``DF1`` | SP to SPMC communication. FF-A function invocation or |
71 | | implementation-defined Hypervisor call. |
72 +---------------------+--------------------------------------------------------+
73 | ``DF2`` | SPMC to SPMD FF-A call. |
74 +---------------------+--------------------------------------------------------+
75 | ``DF3`` | SPMD to NS forwarding. |
76 +---------------------+--------------------------------------------------------+
77 | ``DF4`` | SP to SP FF-A direct message request/response. |
78 | | Note as a matter of simplifying the diagram |
79 | | the SP to SP communication happens through the SPMC |
80 | | (SP1 performs a direct message request to the |
81 | | SPMC targeting SP2 as destination. And similarly for |
82 | | the direct message response from SP2 to SP1). |
83 +---------------------+--------------------------------------------------------+
84 | ``DF5`` | HW control. |
85 +---------------------+--------------------------------------------------------+
86 | ``DF6`` | Bootloader image loading. |
87 +---------------------+--------------------------------------------------------+
88 | ``DF7`` | External memory access. |
89 +---------------------+--------------------------------------------------------+
90
91*********************
92Threat Analysis
93*********************
94
95This threat model follows a similar methodology to the `Generic TF-A threat model`_.
96The following sections define:
97
98- Trust boundaries
99- Assets
100- Theat agents
101- Threat types
102
103Trust boundaries
104============================
105
106- Normal world is untrusted.
107- Secure world and normal world are separate trust boundaries.
108- EL3 monitor, SPMD and SPMC are trusted.
109- Bootloaders (in particular BL1/BL2 if using TF-A) and run-time BL31 are
110 implicitely trusted by the usage of secure boot.
111- EL3 monitor, SPMD, SPMC do not trust SPs.
112
113.. figure:: ../resources/diagrams/spm-threat-model-trust-boundaries.png
114
115 Figure 2: Trust boundaries
116
117Assets
118============================
119
120The following assets are identified:
121
122- SPMC state.
123- SP state.
124- Information exchange between endpoints (partition messages).
125- SPMC secrets (e.g. pointer authentication key when enabled)
126- SP secrets (e.g. application keys).
127- Scheduling cycles.
128- Shared memory.
129
130Threat Agents
131============================
132
133The following threat agents are identified:
134
135- NS-Endpoint identifies a non-secure endpoint: normal world client at NS-EL2
136 (Hypervisor) or NS-EL1 (VM or OS kernel).
137- S-Endpoint identifies a secure endpoint typically a secure partition.
138- Hardware attacks (non-invasive) requiring a physical access to the device,
139 such as bus probing or DRAM stress.
140
141Threat types
142============================
143
144The following threat categories as exposed in the `Generic TF-A threat model`_
145are re-used:
146
147- Spoofing
148- Tampering
149- Repudiation
150- Information disclosure
151- Denial of service
152- Elevation of privileges
153
154Similarly this threat model re-uses the same threat risk ratings. The risk
155analysis is evaluated based on the environment being ``Server`` or ``Mobile``.
156
157Threat Assessment
158============================
159
160The following threats are identified by applying STRIDE analysis on each diagram
161element of the data flow diagram.
162
163+------------------------+----------------------------------------------------+
164| ID | 01 |
165+========================+====================================================+
166| ``Threat`` | **An endpoint impersonates the sender or receiver |
167| | FF-A ID in a direct request/response invocation.** |
168+------------------------+----------------------------------------------------+
169| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
170+------------------------+----------------------------------------------------+
171| ``Affected TF-A | SPMD, SPMC |
172| Components`` | |
173+------------------------+----------------------------------------------------+
174| ``Assets`` | SP state |
175+------------------------+----------------------------------------------------+
176| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
177+------------------------+----------------------------------------------------+
178| ``Threat Type`` | Spoofing |
179+------------------------+------------------+-----------------+---------------+
180| ``Application`` | ``Server`` | ``Mobile`` | |
181+------------------------+------------------++----------------+---------------+
182| ``Impact`` | Critical(5) | Critical(5) | |
183+------------------------+------------------++----------------+---------------+
184| ``Likelihood`` | Critical(5) | Critical(5) | |
185+------------------------+------------------++----------------+---------------+
186| ``Total Risk Rating`` | Critical(25) | Critical(25) | |
187+------------------------+------------------+-----------------+---------------+
188| ``Mitigations`` | The TF-A SPMC does not mitigate this threat. |
189| | The guidance below is left for a system integrator |
190| | to implemented as necessary. |
191| | The SPMC must enforce checks in the direct message |
192| | request/response interfaces such an endpoint cannot|
193| | spoof the origin and destination worlds (e.g. a NWd|
194| | originated message directed to the SWd cannot use a|
195| | SWd ID as the sender ID). |
196| | Additionally a software component residing in the |
197| | SPMC can be added for the purpose of direct |
198| | request/response filtering. |
199| | It can be configured with the list of known IDs |
200| | and about which interaction can occur between one |
201| | and another endpoint (e.g. which NWd endpoint ID |
202| | sends a direct request to which SWd endpoint ID). |
203| | This component checks the sender/receiver fields |
204| | for a legitimate communication between endpoints. |
205| | A similar component can exist in the OS kernel |
206| | driver, or Hypervisor although it remains untrusted|
207| | by the SPMD/SPMC. |
208+------------------------+----------------------------------------------------+
209
210+------------------------+----------------------------------------------------+
211| ID | 02 |
212+========================+====================================================+
213| ``Threat`` | **Tampering with memory shared between an endpoint |
214| | and the SPMC.** |
215| | A malicious endpoint may attempt tampering with its|
216| | RX/TX buffer contents while the SPMC is processing |
217| | it (TOCTOU). |
218+------------------------+----------------------------------------------------+
219| ``Diagram Elements`` | DF1, DF3, DF4, DF7 |
220+------------------------+----------------------------------------------------+
221| ``Affected TF-A | SPMC |
222| Components`` | |
223+------------------------+----------------------------------------------------+
224| ``Assets`` | Shared memory, Information exchange |
225+------------------------+----------------------------------------------------+
226| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
227+------------------------+----------------------------------------------------+
228| ``Threat Type`` | Tampering |
229+------------------------+------------------+-----------------+---------------+
230| ``Application`` | ``Server`` | ``Mobile`` | |
231+------------------------+------------------+-----------------+---------------+
232| ``Impact`` | High (4) | High (4) | |
233+------------------------+------------------+-----------------+---------------+
234| ``Likelihood`` | High (4) | High (4) | |
235+------------------------+------------------+-----------------+---------------+
236| ``Total Risk Rating`` | High (16) | High (16) | |
237+------------------------+------------------+-----------------+---------------+
238| ``Mitigations`` | In context of FF-A v1.0 this is the case of sharing|
239| | the RX/TX buffer pair and usage in the |
240| | PARTITION_INFO_GET or mem sharing primitives. |
241| | The SPMC must copy the contents of the TX buffer |
242| | to an internal temporary buffer before processing |
243| | its contents. The SPMC must implement hardened |
244| | input validation on data transmitted through the TX|
245| | buffer by an untrusted endpoint. |
246| | The TF-A SPMC mitigates this threat by enforcing |
247| | checks on data transmitted through RX/TX buffers. |
248+------------------------+----------------------------------------------------+
249
250+------------------------+----------------------------------------------------+
251| ID | 03 |
252+========================+====================================================+
253| ``Threat`` | **An endpoint may tamper with its own state or the |
254| | state of another endpoint.** |
255| | A malicious endpoint may attempt violating: |
256| | - its own or another SP state by using an unusual |
257| | combination (or out-of-order) FF-A function |
258| | invocations. |
259| | This can also be an endpoint emitting |
260| | FF-A function invocations to another endpoint while|
261| | the latter in not in a state to receive it (e.g. a |
262| | SP sends a direct request to the normal world early|
263| | while the normal world is not booted yet). |
264| | - the SPMC state itself by employing unexpected |
265| | transitions in FF-A memory sharing, direct requests|
266| | and responses, or handling of interrupts. |
267| | This can be led by random stimuli injection or |
268| | fuzzing. |
269+------------------------+----------------------------------------------------+
270| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
271+------------------------+----------------------------------------------------+
272| ``Affected TF-A | SPMD, SPMC |
273| Components`` | |
274+------------------------+----------------------------------------------------+
275| ``Assets`` | SP state, SPMC state |
276+------------------------+----------------------------------------------------+
277| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
278+------------------------+----------------------------------------------------+
279| ``Threat Type`` | Tampering |
280+------------------------+------------------+-----------------+---------------+
281| ``Application`` | ``Server`` | ``Mobile`` | |
282+------------------------+------------------+-----------------+---------------+
283| ``Impact`` | High (4) | High (4) | |
284+------------------------+------------------+-----------------+---------------+
285| ``Likelihood`` | Medium (3) | Medium (3) | |
286+------------------------+------------------+-----------------+---------------+
287| ``Total Risk Rating`` | High (12) | High (12) | |
288+------------------------+------------------+-----------------+---------------+
289| ``Mitigations`` | The SPMC may be vulnerable to invalid state |
290| | transitions for itself or while handling an SP |
291| | state. The FF-A v1.1 specification provides a |
292| | guidance on those state transitions (run-time |
293| | model). The TF-A SPMC will be hardened in future |
294| | releases to follow this guidance. |
295| | Additionally The TF-A SPMC mitigates the threat by |
296| | runs of the Arm `FF-A ACS`_ compliance test suite. |
297+------------------------+----------------------------------------------------+
298
299+------------------------+----------------------------------------------------+
300| ID | 04 |
301+========================+====================================================+
302| ``Threat`` | *An attacker may attempt injecting errors by the |
303| | use of external DRAM stress techniques.** |
304| | A malicious agent may attempt toggling an SP |
305| | Stage-2 MMU descriptor bit within the page tables |
306| | that the SPMC manages. This can happen in Rowhammer|
307| | types of attack. |
308+------------------------+----------------------------------------------------+
309| ``Diagram Elements`` | DF7 |
310+------------------------+----------------------------------------------------+
311| ``Affected TF-A | SPMC |
312| Components`` | |
313+------------------------+----------------------------------------------------+
314| ``Assets`` | SP or SPMC state |
315+------------------------+----------------------------------------------------+
316| ``Threat Agent`` | Hardware attack |
317+------------------------+----------------------------------------------------+
318| ``Threat Type`` | Tampering |
319+------------------------+------------------+---------------+-----------------+
320| ``Application`` | ``Server`` | ``Mobile`` | |
321+------------------------+------------------+---------------+-----------------+
322| ``Impact`` | High (4) | High (4) | |
323+------------------------+------------------+---------------+-----------------+
324| ``Likelihood`` | Low (2) | Medium (3) | |
325+------------------------+------------------+---------------+-----------------+
326| ``Total Risk Rating`` | Medium (8) | High (12) | |
327+------------------------+------------------+---------------+-----------------+
328| ``Mitigations`` | The TF-A SPMC does not provide mitigations to this |
329| | type of attack. It can be addressed by the use of |
330| | dedicated HW circuity or hardening at the chipset |
331| | or platform level left to the integrator. |
332+------------------------+----------------------------------------------------+
333
334+------------------------+----------------------------------------------------+
335| ID | 05 |
336+========================+====================================================+
337| ``Threat`` | **Protection of the SPMC from a DMA capable device |
338| | upstream to an SMMU.** |
339| | A device may attempt to tamper with the internal |
340| | SPMC code/data sections. |
341+------------------------+----------------------------------------------------+
342| ``Diagram Elements`` | DF5 |
343+------------------------+----------------------------------------------------+
344| ``Affected TF-A | SPMC |
345| Components`` | |
346+------------------------+----------------------------------------------------+
347| ``Assets`` | SPMC or SP state |
348+------------------------+----------------------------------------------------+
349| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
350+------------------------+----------------------------------------------------+
351| ``Threat Type`` | Tampering, Elevation of privileges |
352+------------------------+------------------+---------------+-----------------+
353| ``Application`` | ``Server`` | ``Mobile`` | |
354+------------------------+------------------+---------------+-----------------+
355| ``Impact`` | High (4) | High (4) | |
356+------------------------+------------------+---------------+-----------------+
357| ``Likelihood`` | Medium (3) | Medium (3) | |
358+------------------------+------------------+---------------+-----------------+
359| ``Total Risk Rating`` | High (12) | High (12) | |
360+------------------------+------------------+---------------+-----------------+
361| ``Mitigations`` | A platform may prefer assigning boot time, |
362| | statically alocated memory regions through the SMMU|
363| | configuration and page tables. The FF-A v1.1 |
364| | specification provisions this capability through |
365| | static DMA isolation. |
366| | The TF-A SPMC does not mitigate this threat. |
367| | It will adopt the static DMA isolation approach in |
368| | a future release. |
369+------------------------+----------------------------------------------------+
370
371+------------------------+----------------------------------------------------+
372| ID | 06 |
373+========================+====================================================+
374| ``Threat`` | **Replay fragments of past communication between |
375| | endpoints.** |
376| | A malicious endpoint may replay a message exchange |
377| | that occured between two legitimate endpoint as |
378| | a matter of triggering a malfunction or extracting |
379| | secrets from the receiving endpoint. In particular |
380| | the memory sharing operation with fragmented |
381| | messages between an endpoint and the SPMC may be |
382| | replayed by a malicious agent as a matter of |
383| | getting access or gaining permissions to a memory |
384| | region which does not belong to this agent. |
385+------------------------+----------------------------------------------------+
386| ``Diagram Elements`` | DF2, DF3 |
387+------------------------+----------------------------------------------------+
388| ``Affected TF-A | SPMC |
389| Components`` | |
390+------------------------+----------------------------------------------------+
391| ``Assets`` | Information exchange |
392+------------------------+----------------------------------------------------+
393| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
394+------------------------+----------------------------------------------------+
395| ``Threat Type`` | Repdudiation |
396+------------------------+------------------+---------------+-----------------+
397| ``Application`` | ``Server`` | ``Mobile`` | |
398+------------------------+------------------+---------------+-----------------+
399| ``Impact`` | Medium (3) | Medium (3) | |
400+------------------------+------------------+---------------+-----------------+
401| ``Likelihood`` | High (4) | High (4) | |
402+------------------------+------------------+---------------+-----------------+
403| ``Total Risk Rating`` | High (12) | High (12) | |
404+------------------------+------------------+---------------+-----------------+
405| ``Mitigations`` | The TF-A SPMC does not mitigate this threat. |
406+------------------------+----------------------------------------------------+
407
408+------------------------+----------------------------------------------------+
409| ID | 07 |
410+========================+====================================================+
411| ``Threat`` | **A malicious endpoint may attempt to extract data |
412| | or state information by the use of invalid or |
413| | incorrect input arguments.** |
414| | Lack of input parameter validation or side effects |
415| | of maliciously forged input parameters might affect|
416| | the SPMC. |
417+------------------------+----------------------------------------------------+
418| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
419+------------------------+----------------------------------------------------+
420| ``Affected TF-A | SPMD, SPMC |
421| Components`` | |
422+------------------------+----------------------------------------------------+
423| ``Assets`` | SP secrets, SPMC secrets, SP state, SPMC state |
424+------------------------+----------------------------------------------------+
425| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
426+------------------------+----------------------------------------------------+
427| ``Threat Type`` | Information discolure |
428+------------------------+------------------+---------------+-----------------+
429| ``Application`` | ``Server`` | ``Mobile`` | |
430+------------------------+------------------+---------------+-----------------+
431| ``Impact`` | High (4) | High (4) | |
432+------------------------+------------------+---------------+-----------------+
433| ``Likelihood`` | Medium (3) | Medium (3) | |
434+------------------------+------------------+---------------+-----------------+
435| ``Total Risk Rating`` | High (12) | High (12) | |
436+------------------------+------------------+---------------+-----------------+
437| ``Mitigations`` | Secure Partitions must follow security standards |
438| | and best practises as a way to mitigate the risk |
439| | of common vulnerabilities to be exploited. |
440| | The use of software (canaries) or hardware |
441| | hardening techniques (XN, WXN, BTI, pointer |
442| | authentication, MTE) helps detecting and stopping |
443| | an exploitation early. |
444| | The TF-A SPMC mitigates this threat by implementing|
445| | stack protector, pointer authentication, BTI, XN, |
446| | WXN, security hardening techniques. |
447+------------------------+----------------------------------------------------+
448
449+------------------------+----------------------------------------------------+
450| ID | 08 |
451+========================+====================================================+
452| ``Threat`` | **A malicious endpoint may forge a direct message |
453| | request such that it reveals the internal state of |
454| | another endpoint through the direct message |
455| | response.** |
456| | The secure partition or SPMC replies to a partition|
457| | message by a direct message response with |
458| | information which may reveal its internal state |
459| | (.e.g. partition message response outside of |
460| | allowed bounds). |
461+------------------------+----------------------------------------------------+
462| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
463+------------------------+----------------------------------------------------+
464| ``Affected TF-A | SPMC |
465| Components`` | |
466+------------------------+----------------------------------------------------+
467| ``Assets`` | SPMC or SP state |
468+------------------------+----------------------------------------------------+
469| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
470+------------------------+----------------------------------------------------+
471| ``Threat Type`` | Information discolure |
472+------------------------+------------------+---------------+-----------------+
473| ``Application`` | ``Server`` | ``Mobile`` | |
474+------------------------+------------------+---------------+-----------------+
475| ``Impact`` | Medium (3) | Medium (3) | |
476+------------------------+------------------+---------------+-----------------+
477| ``Likelihood`` | Low (2) | Low (2) | |
478+------------------------+------------------+---------------+-----------------+
479| ``Total Risk Rating`` | Medium (6) | Medium (6) | |
480+------------------------+------------------+---------------+-----------------+
J-Alvesfce56802021-11-11 17:23:53 +0000481| ``Mitigations`` | For the specific case of direct requests targeting |
Olivier Deprez86d1ffd2021-06-01 15:37:16 +0200482| | the SPMC, the latter is hardened to prevent |
483| | its internal state or the state of an SP to be |
484| | revealed through a direct message response. |
485| | Further FF-A v1.1 guidance about run time models |
486| | and partition states will be implemented in future |
487| | TF-A SPMC releases. |
488+------------------------+----------------------------------------------------+
489
490+------------------------+----------------------------------------------------+
491| ID | 09 |
492+========================+====================================================+
493| ``Threat`` | **Probing the FF-A communication between |
494| | endpoints.** |
495| | SPMC and SPs are typically loaded to external |
496| | memory (protected by a TrustZone memory |
497| | controller). A malicious agent may use non invasive|
498| | methods to probe the external memory bus and |
499| | extract the traffic between an SP and the SPMC or |
500| | among SPs when shared buffers are held in external |
501| | memory. |
502+------------------------+----------------------------------------------------+
503| ``Diagram Elements`` | DF7 |
504+------------------------+----------------------------------------------------+
505| ``Affected TF-A | SPMC |
506| Components`` | |
507+------------------------+----------------------------------------------------+
508| ``Assets`` | SP/SPMC state, SP/SPMC secrets |
509+------------------------+----------------------------------------------------+
510| ``Threat Agent`` | Hardware attack |
511+------------------------+----------------------------------------------------+
512| ``Threat Type`` | Information disclosure |
513+------------------------+------------------+-----------------+---------------+
514| ``Application`` | ``Server`` | ``Mobile`` | |
515+------------------------+------------------+-----------------+---------------+
516| ``Impact`` | Medium (3) | Medium (3) | |
517+------------------------+------------------+-----------------+---------------+
518| ``Likelihood`` | Low (2) | Medium (3) | |
519+------------------------+------------------+-----------------+---------------+
520| ``Total Risk Rating`` | Medium (6) | Medium (9) | |
521+------------------------+------------------+-----------------+---------------+
522| ``Mitigations`` | It is expected the platform or chipset provides |
523| | guarantees in protecting the DRAM contents. |
524| | The TF-A SPMC does not mitigate this class of |
525| | attack and this is left to the integrator. |
526+------------------------+----------------------------------------------------+
527
528+------------------------+----------------------------------------------------+
529| ID | 10 |
530+========================+====================================================+
531| ``Threat`` | **A malicious agent may attempt revealing the SPMC |
532| | state or secrets by the use of software-based cache|
533| | side-channel attack techniques.** |
534+------------------------+----------------------------------------------------+
535| ``Diagram Elements`` | DF7 |
536+------------------------+----------------------------------------------------+
537| ``Affected TF-A | SPMC |
538| Components`` | |
539+------------------------+----------------------------------------------------+
540| ``Assets`` | SP or SPMC state |
541+------------------------+----------------------------------------------------+
542| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
543+------------------------+----------------------------------------------------+
544| ``Threat Type`` | Information disclosure |
545+------------------------+------------------+-----------------+---------------+
546| ``Application`` | ``Server`` | ``Mobile`` | |
547+------------------------+------------------+-----------------+---------------+
548| ``Impact`` | Medium (3) | Medium (3) | |
549+------------------------+------------------+-----------------+---------------+
550| ``Likelihood`` | Low (2) | Low (2) | |
551+------------------------+------------------+-----------------+---------------+
552| ``Total Risk Rating`` | Medium (6) | Medium (6) | |
553+------------------------+------------------+-----------------+---------------+
554| ``Mitigations`` | From an integration perspective it is assumed |
555| | platforms consuming the SPMC component at S-EL2 |
556| | (hence implementing the Armv8.4 FEAT_SEL2 |
557| | architecture extension) implement mitigations to |
558| | Spectre, Meltdown or other cache timing |
559| | side-channel type of attacks. |
560| | The TF-A SPMC implements one mitigation (barrier |
561| | preventing speculation past exeception returns). |
562| | The SPMC may be hardened further with SW |
563| | mitigations (e.g. speculation barriers) for the |
564| | cases not covered in HW. Usage of hardened |
565| | compilers and appropriate options, code inspection |
566| | are recommended ways to mitigate Spectre types of |
567| | attacks. For non-hardened cores, the usage of |
568| | techniques such a kernel page table isolation can |
569| | help mitigating Meltdown type of attacks. |
570+------------------------+----------------------------------------------------+
571
572+------------------------+----------------------------------------------------+
573| ID | 11 |
574+========================+====================================================+
575| ``Threat`` | **A malicious endpoint may attempt flooding the |
J-Alvesfce56802021-11-11 17:23:53 +0000576| | SPMC with requests targeting a service within an |
Olivier Deprez86d1ffd2021-06-01 15:37:16 +0200577| | endpoint such that it denies another endpoint to |
578| | access this service.** |
579| | Similarly, the malicious endpoint may target a |
580| | a service within an endpoint such that the latter |
581| | is unable to request services from another |
582| | endpoint. |
583+------------------------+----------------------------------------------------+
584| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
585+------------------------+----------------------------------------------------+
586| ``Affected TF-A | SPMC |
587| Components`` | |
588+------------------------+----------------------------------------------------+
589| ``Assets`` | SPMC state |
590+------------------------+----------------------------------------------------+
591| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
592+------------------------+----------------------------------------------------+
593| ``Threat Type`` | Denial of service |
594+------------------------+------------------+-----------------+---------------+
595| ``Application`` | ``Server`` | ``Mobile`` | |
596+------------------------+------------------+-----------------+---------------+
597| ``Impact`` | Medium (3) | Medium (3) | |
598+------------------------+------------------+-----------------+---------------+
599| ``Likelihood`` | Medium (3) | Medium (3) | |
600+------------------------+------------------+-----------------+---------------+
601| ``Total Risk Rating`` | Medium (9) | Medium (9) | |
602+------------------------+------------------+-----------------+---------------+
603| ``Mitigations`` | The TF-A SPMC does not mitigate this threat. |
604| | Bounding the time for operations to complete can |
605| | be achieved by the usage of a trusted watchdog. |
606| | Other quality of service monitoring can be achieved|
607| | in the SPMC such as counting a number of operations|
608| | in a limited timeframe. |
609+------------------------+----------------------------------------------------+
610
J-Alvesfce56802021-11-11 17:23:53 +0000611+------------------------+----------------------------------------------------+
612| ID | 12 |
613+========================+====================================================+
614| ``Threat`` | **A malicious endpoint may attempt to allocate |
615| | notifications bitmaps in the SPMC, through the |
616| | FFA_NOTIFICATION_BITMAP_CREATE.** |
617| | This might be an attempt to exhaust SPMC's memory, |
618| | or to allocate a bitmap for a VM that was not |
619| | intended to receive notifications from SPs. Thus |
620| | creating the possibility for a channel that was not|
621| | meant to exist. |
622+------------------------+----------------------------------------------------+
623| ``Diagram Elements`` | DF1, DF2, DF3 |
624+------------------------+----------------------------------------------------+
625| ``Affected TF-A | SPMC |
626| Components`` | |
627+------------------------+----------------------------------------------------+
628| ``Assets`` | SPMC state |
629+------------------------+----------------------------------------------------+
630| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
631+------------------------+----------------------------------------------------+
632| ``Threat Type`` | Denial of service, Spoofing |
633+------------------------+------------------+-----------------+---------------+
634| ``Application`` | ``Server`` | ``Mobile`` | |
635+------------------------+------------------+-----------------+---------------+
636| ``Impact`` | Medium(3) | Medium(3) | |
637+------------------------+------------------+-----------------+---------------+
638| ``Likelihood`` | Medium(3) | Medium(3) | |
639+------------------------+------------------+-----------------+---------------+
640| ``Total Risk Rating`` | Medium(9) | Medium(9) | |
641+------------------------+------------------+-----------------+---------------+
642| ``Mitigations`` | The TF-A SPMC mitigates this threat by defining a |
643| | a fixed size pool for bitmap allocation. |
644| | It also limits the designated FF-A calls to be used|
645| | from NWd endpoints. |
646| | In the NWd the hypervisor is supposed to limit the |
647| | access to the designated FF-A call. |
648+------------------------+----------------------------------------------------+
649
650+------------------------+----------------------------------------------------+
651| ID | 13 |
652+========================+====================================================+
653| ``Threat`` | **A malicious endpoint may attempt to destroy the |
654| | notifications bitmaps in the SPMC, through the |
655| | FFA_NOTIFICATION_BITMAP_DESTROY.** |
656| | This might be an attempt to tamper with the SPMC |
657| | state such that a partition isn't able to receive |
658| | notifications. |
659+------------------------+----------------------------------------------------+
660| ``Diagram Elements`` | DF1, DF2, DF3 |
661+------------------------+----------------------------------------------------+
662| ``Affected TF-A | SPMC |
663| Components`` | |
664+------------------------+----------------------------------------------------+
665| ``Assets`` | SPMC state |
666+------------------------+----------------------------------------------------+
667| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
668+------------------------+----------------------------------------------------+
669| ``Threat Type`` | Tampering |
670+------------------------+------------------+-----------------+---------------+
671| ``Application`` | ``Server`` | ``Mobile`` | |
672+------------------------+------------------+-----------------+---------------+
673| ``Impact`` | Low(2) | Low(2) | |
674+------------------------+------------------+-----------------+---------------+
675| ``Likelihood`` | Low(2) | Low(2) | |
676+------------------------+------------------+-----------------+---------------+
677| ``Total Risk Rating`` | Low(4) | Low(4) | |
678+------------------------+------------------+-----------------+---------------+
679| ``Mitigations`` | The TF-A SPMC mitigates this issue by limiting the |
680| | designated FF-A call to be issued by the NWd. |
681| | Also, the notifications bitmap can't be destroyed |
682| | if there are pending notifications. |
683| | In the NWd, the hypervisor must restrict the |
684| | NS-endpoints that can issue the designated call. |
685+------------------------+----------------------------------------------------+
686
687+------------------------+----------------------------------------------------+
688| ID | 14 |
689+========================+====================================================+
690| ``Threat`` | **A malicious endpoint might attempt to give |
691| | permissions to an unintended sender to set |
692| | notifications targeting another receiver using the |
693| | FF-A call FFA_NOTIFICATION_BIND.** |
694| | This might be an attempt to tamper with the SPMC |
695| | state such that an unintended, and possibly |
696| | malicious, communication channel is established. |
697+------------------------+----------------------------------------------------+
698| ``Diagram Elements`` | DF1, DF2, DF3 |
699+------------------------+----------------------------------------------------+
700| ``Affected TF-A | SPMC |
701| Components`` | |
702+------------------------+----------------------------------------------------+
703| ``Assets`` | SPMC state |
704+------------------------+----------------------------------------------------+
705| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
706+------------------------+----------------------------------------------------+
707| ``Threat Type`` | Tampering, Spoofing |
708+------------------------+------------------+-----------------+---------------+
709| ``Application`` | ``Server`` | ``Mobile`` | |
710+------------------------+------------------+-----------------+---------------+
711| ``Impact`` | Low(2) | Low(2) | |
712+------------------------+------------------+-----------------+---------------+
713| ``Likelihood`` | Medium(3) | Medium(3) | |
714+------------------------+------------------+-----------------+---------------+
715| ``Total Risk Rating`` | Medium(6) | Medium(6) | |
716+------------------------+------------------+-----------------+---------------+
717| ``Mitigations`` | The TF-A SPMC mitigates this by restricting |
718| | designated FFA_NOTIFICATION_BIND call to be issued |
719| | by the receiver only. The receiver is responsible |
720| | for allocating the notifications IDs to one |
721| | specific partition. |
722| | Also, receivers that are not meant to receive |
723| | notifications, must have notifications receipt |
724| | disabled in the respective partition's manifest. |
725| | As for calls coming from NWd, if the NWd VM has had|
726| | its bitmap allocated at initialization, the TF-A |
727| | SPMC can't guarantee this threat won't happen. |
728| | The Hypervisor must mitigate in the NWd, similarly |
729| | to SPMC for calls in SWd. Though, if the Hypervisor|
730| | has been compromised, the SPMC won't be able to |
731| | mitigate it for calls forwarded from NWd. |
732+------------------------+----------------------------------------------------+
733
734+------------------------+----------------------------------------------------+
735| ID | 15 |
736+========================+====================================================+
737| ``Threat`` | **A malicious partition endpoint might attempt to |
738| | set notifications that are not bound to it.** |
739+------------------------+----------------------------------------------------+
740| ``Diagram Elements`` | DF1, DF2, DF3 |
741+------------------------+----------------------------------------------------+
742| ``Affected TF-A | SPMC |
743| Components`` | |
744+------------------------+----------------------------------------------------+
745| ``Assets`` | SPMC state |
746+------------------------+----------------------------------------------------+
747| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
748+------------------------+----------------------------------------------------+
749| ``Threat Type`` | Spoofing |
750+------------------------+------------------+-----------------+---------------+
751| ``Application`` | ``Server`` | ``Mobile`` | |
752+------------------------+------------------+-----------------+---------------+
753| ``Impact`` | Low(2) | Low(2) | |
754+------------------------+------------------+-----------------+---------------+
755| ``Likelihood`` | Low(2) | Low(2) | |
756+------------------------+------------------+-----------------+---------------+
757| ``Total Risk Rating`` | Low(4) | Low(4) | |
758+------------------------+------------------+-----------------+---------------+
759| ``Mitigations`` | The TF-A SPMC mitigates this by checking the |
760| | sender's ID provided in the input to the call |
761| | FFA_NOTIFICATION_SET. The SPMC keeps track of which|
762| | notifications are bound to which sender, for a |
763| | given receiver. If the sender is an SP, the |
764| | provided sender ID must match the ID of the |
765| | currently running partition. |
766+------------------------+----------------------------------------------------+
767
768+------------------------+----------------------------------------------------+
769| ID | 16 |
770+========================+====================================================+
771| ``Threat`` | **A malicious partition endpoint might attempt to |
772| | get notifications that are not targeted to it.** |
773+------------------------+----------------------------------------------------+
774| ``Diagram Elements`` | DF1, DF2, DF3 |
775+------------------------+----------------------------------------------------+
776| ``Affected TF-A | SPMC |
777| Components`` | |
778+------------------------+----------------------------------------------------+
779| ``Assets`` | SPMC state |
780+------------------------+----------------------------------------------------+
781| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
782+------------------------+----------------------------------------------------+
783| ``Threat Type`` | Spoofing |
784+------------------------+------------------+-----------------+---------------+
785| ``Application`` | ``Server`` | ``Mobile`` | |
786+------------------------+------------------+-----------------+---------------+
787| ``Impact`` | Informational(1) | Informational(1)| |
788+------------------------+------------------+-----------------+---------------+
789| ``Likelihood`` | Low(2) | Low(2) | |
790+------------------------+------------------+-----------------+---------------+
791| ``Total Risk Rating`` | Low(2) | Low(2) | |
792+------------------------+------------------+-----------------+---------------+
793| ``Mitigations`` | The TF-A SPMC mitigates this by checking the |
794| | receiver's ID provided in the input to the call |
795| | FFA_NOTIFICATION_GET. The SPMC keeps track of which|
796| | notifications are pending for each receiver. |
797| | The provided receiver ID must match the ID of the |
798| | currently running partition, if it is an SP. |
799| | For calls forwarded from NWd, the SPMC will return |
800| | the pending notifications if the receiver had its |
801| | bitmap created, and has pending notifications. |
802| | If Hypervisor or OS kernel are compromised, the |
803| | SPMC won't be able to mitigate calls from rogue NWd|
804| | endpoints. |
805+------------------------+----------------------------------------------------+
806
807+------------------------+----------------------------------------------------+
808| ID | 17 |
809+========================+====================================================+
810| ``Threat`` | **A malicious partition endpoint might attempt to |
811| | get the information about pending notifications, |
812| | through the FFA_NOTIFICATION_INFO_GET call.** |
813| | This call is meant to be used by the NWd FF-A |
814| | driver. |
815+------------------------+----------------------------------------------------+
816| ``Diagram Elements`` | DF1, DF2, DF3 |
817+------------------------+----------------------------------------------------+
818| ``Affected TF-A | SPMC |
819| Components`` | |
820+------------------------+----------------------------------------------------+
821| ``Assets`` | SPMC state |
822+------------------------+----------------------------------------------------+
823| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
824+------------------------+----------------------------------------------------+
825| ``Threat Type`` | Information disclosure |
826+------------------------+------------------+-----------------+---------------+
827| ``Application`` | ``Server`` | ``Mobile`` | |
828+------------------------+------------------+-----------------+---------------+
829| ``Impact`` | Low(2) | Low(2) | |
830+------------------------+------------------+-----------------+---------------+
831| ``Likelihood`` | Medium(3) | Medium(3) | |
832+------------------------+------------------+-----------------+---------------+
833| ``Total Risk Rating`` | Medium(6) | Medium(6) | |
834+------------------------+------------------+-----------------+---------------+
835| ``Mitigations`` | The TF-A SPMC mitigates this by returning error to |
836| | calls made by SPs to FFA_NOTIFICATION_INFO_GET. |
837| | If Hypervisor or OS kernel are compromised, the |
838| | SPMC won't be able mitigate calls from rogue NWd |
839| | endpoints. |
840+------------------------+----------------------------------------------------+
841
842+------------------------+----------------------------------------------------+
843| ID | 18 |
844+========================+====================================================+
845| ``Threat`` | **A malicious partition endpoint might attempt to |
846| | flood another partition endpoint with notifications|
847| | hindering its operation.** |
848| | The intent of the malicious endpoint could be to |
849| | interfere with both the receiver's and/or primary |
850| | endpoint execution, as they can both be preempted |
851| | by the NPI and SRI, respectively. |
852+------------------------+----------------------------------------------------+
853| ``Diagram Elements`` | DF1, DF2, DF3, DF4 |
854+------------------------+----------------------------------------------------+
855| ``Affected TF-A | SPMC |
856| Components`` | |
857+------------------------+----------------------------------------------------+
858| ``Assets`` | SPMC state, SP state, CPU cycles |
859+------------------------+----------------------------------------------------+
860| ``Threat Agent`` | NS-Endpoint, S-Endpoint |
861+------------------------+----------------------------------------------------+
862| ``Threat Type`` | DoS |
863+------------------------+------------------+-----------------+---------------+
864| ``Application`` | ``Server`` | ``Mobile`` | |
865+------------------------+------------------+-----------------+---------------+
866| ``Impact`` | Low(2) | Low(2) | |
867+------------------------+------------------+-----------------+---------------+
868| ``Likelihood`` | Medium(3) | Medium(3) | |
869+------------------------+------------------+-----------------+---------------+
870| ``Total Risk Rating`` | Medium(6) | Medium(6) | |
871+------------------------+------------------+-----------------+---------------+
872| ``Mitigations`` | The TF-A SPMC does not mitigate this threat. |
873| | However, the impact is limited due to the |
874| | architecture: |
875| | - Notifications are not queued, one that has been |
876| | signaled needs to be retrieved by the receiver, |
877| | until it can be sent again. |
878| | - Both SRI and NPI can't be pended until handled |
879| | which limits the amount of spurious interrupts. |
880| | - A given receiver could only bind a maximum number|
881| | of notifications to a given sender, within a given |
882| | execution context. |
883+------------------------+----------------------------------------------------+
884
885---------------
Olivier Deprez86d1ffd2021-06-01 15:37:16 +0200886
887*Copyright (c) 2021, Arm Limited. All rights reserved.*
888
Olivier Deprez2b0be752021-09-01 10:25:21 +0200889.. _Arm Firmware Framework for Arm A-profile: https://developer.arm.com/docs/den0077/latest
Olivier Deprez86d1ffd2021-06-01 15:37:16 +0200890.. _Secure Partition Manager: ../components/secure-partition-manager.html
891.. _Generic TF-A threat model: ./threat_model.html#threat-analysis
892.. _FF-A ACS: https://github.com/ARM-software/ff-a-acs/releases