Skip to content

Commit 0f20086

Browse files
andreeafloresculauralt
authored andcommitted
extended threat model documentation
Extended the documentation for the serial console by adding one more threat along with the mitigation, and adding some more details to the existing one. Added threat model documentation for the RTC device. Signed-off-by: Andreea Florescu <fandree@amazon.com>
1 parent 210a24d commit 0f20086

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ the driver to an `io::Write` object (`out`), which can be, for example,
4242
A `Trigger` object is the currently used mechanism for notifying the driver
4343
about in/out events that need to be handled.
4444

45+
## Threat model
46+
47+
Trusted actors:
48+
* host kernel
49+
50+
Untrusted actors:
51+
* guest kernel
52+
* guest drivers
53+
54+
The untrusted actors can change the state of the device through reads and
55+
writes on the Bus at the address where the device resides.
56+
57+
|#NR |Threat |Mitigation |
58+
|--- |--- |--- |
59+
|1 | A malicious guest generates large memory allocations by flooding the serial console input. [CVE-2020-27173](https://nvd.nist.gov/vuln/detail/CVE-2020-27173) |The serial console limits the number of elements in the FIFO corresponding to the serial console input to `FIFO_SIZE` (=64), returning a FIFO Full error when the limit is reached. This error MUST be handled by the crate customer. When the serial console input is connected to an event loop, the customer MUST ensure that the loop is not flooded with events coming from untrusted sources when no space is available in the FIFO. |
60+
|2 |A malicious guest can fill up the host disk by generating a high amount of data to be written to the serial output. |Mitigation is not possible at the emulation layer because we are not controlling the output (`Writer`). This needs to be mitigated at the VMM level by adding a rate limiting mechanism. We recommend using as output a resource that has a fixed size (e.g. ring buffer or a named pipe). |
61+
4562
### Usage
4663

4764
The interaction between the serial console and its driver, at the emulation
@@ -74,23 +91,22 @@ Note that because the Match Register is the only possible source of an event,
7491
and the Match Register is not currently implemented, no event handling
7592
is required.
7693

77-
## Threat model
94+
### Threat model
7895

7996
Trusted actors:
80-
- host kernel.
97+
* host kernel
8198

8299
Untrusted actors:
83-
- guest kernel,
84-
- guest drivers.
100+
* guest kernel
101+
* guest drivers
85102

86-
For the serial console, there is no monitoring of the amount of data that is
87-
written to the `out` object.
103+
The untrusted actors can change the state of the device through reads and
104+
writes on the Bus at the address where the device resides.
88105

89-
*Threat*: A malicious guest can fill up the host disk by generating a high
90-
amount of data to be written to the serial output.
91-
*Mitigation*: There is no mitigation implemented at the serial console emulation
92-
level. To mitigate this at the VMM level, it is recommended to use as output a
93-
resource that has a fixed size (e.g. ring buffer or a named pipe).
106+
|#NR |Threat |Mitigation |
107+
|--- |--- |--- |
108+
|1 |A malicious guest writes invalid values in the Load Register to cause overflows on subsequent reads of the Data Register. |The arithmetic operations in the RTC are checked for overflows. When such a situation occurs, the state of the device is reset. |
109+
|2 |A malicious guest performs reads and writes from invalid offsets (that do not correspond to the RTC registers) to cause crashes or to get access to data. |Reads and writes of invalid offsets are denied by the emulation, and an `invalid_read/write` event is called. These events can be implemented by VMMs, and extend them to generate alarms (and for example stop the execution of the malicious guest). |
94110

95111
## License
96112

0 commit comments

Comments
 (0)