Skip to content

Commit 6b8b353

Browse files
add threat model documentation
The input of vm-fdt is considered trusted. This needs to be explictly mentioned in the threat model documentation. Signed-off-by: Andreea Florescu <fandree@amazon.com>
1 parent 720e48e commit 6b8b353

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ operations are:
4444
* `property_array_u64`
4545
* `property` (raw byte array)
4646

47+
## Threat Model
48+
49+
*Input*: The caller of the vm-fdt public interface is trusted.
50+
51+
*Output*: The content of the FDT blob resides in memory, and it’s trusted. The
52+
memory allocated by this crate is directly proportional with the number of
53+
nodes and properties defined by the user (through the `property*` and
54+
`begin_node` functions).
55+
56+
|#NR|Threat|Mitigation|
57+
|---|---|---|
58+
|1|Due to a programming error the FDT code causes large memory allocations.|The operator of the vm-fdt interface is trusted, and the memory allocations are directly proportional to the number of calls to the public FDT interface. At the vm-fdt level, the maximum size allowed for the blob is 4.3 GB. This is enforced by checking that the length of the data blob fits in an u32, and the maximum value of an u32 is 4294967295 (~4.3 GB). The caller of the vm-fdt interface can check the size of the FDT blob upon calling the finish function.|
59+
|2|Passing large arrays of memory reservations when initializing the FdtWriter leads to undefined behavior.|The length of the memory reservations is checked. All subsequent operations based on input are checked for overflows.|
60+
|3|Passing overlapping memory reservations when initializing the FdtWriter leads to undefined behavior when loading the blob in guest memory|The FDT specification explicitly defines that the memory reservation entries MUST not overlap. This is enforced by the FdtWriter, and checked in the [unit tests.](https://github.com/rust-vmm/vm-fdt/blob/c89583fa4975cd80a232bd4cdd0efd74c2ca219d/src/writer.rs#L897)|
61+
4762
## Usage
4863

4964
The following code is creating an FDT blob with a root node that has 3

0 commit comments

Comments
 (0)