Commit afa4c7a5 authored by Santeri Toikka's avatar Santeri Toikka
Browse files

Changed the memory handling to allow one as the default init value

Closes Hw14 #123
parent 873a7ca0
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -778,24 +778,26 @@ The product shall reject writes to fixed-size arrays that are beyond the end of
* Verdict: each involved thread fails to read or write the target data and takes a segmentation fault, has error handling code executed, or is terminated in all tests => PASS, otherwise FAIL
* Evidence: error messages, log message, or the product reboots or halts

#### 5.2.2.11 MI-MZRO-1: Stack memory zeroing
#### 5.2.2.11 MI-MZRO-1: Stack memory initializing

The product shall zero-initialize all stack memory before use.
The product shall initialize all stack memory before use.

* Reference: ER-SSDD
* Objective: Prevent attacker from exploiting erroneous use of uninitialized stack memory
* Activities: Sequentially call 2 functions that allocate the same amount of memory, fill the first with non-zero values and return, and during second function call, read the stack contents back
* Verdict: Stack contents are all zero on second call => PASS, otherwise FAIL
* Preparation: Define initialization value to be zero or one
* Activities: Sequentially call 2 functions that allocate the same amount of memory, fill the first with non-initialization values and return, and during second function call, read the stack contents back
* Verdict: Stack contents are all set to initialization value on second call => PASS, otherwise FAIL
* Evidence: Contents of stack before the first function return, contents of stack during the second function call

#### 5.2.2.12 MI-MZRO-2: Heap memory zeroing
#### 5.2.2.12 MI-MZRO-2: Heap memory initializing

The product shall zero-initialize all heap memory before use.
The product shall initialize all heap memory before use.

* Reference: ER-SSDD
* Objective: Prevent attacker from exploiting erroneous use of uninitialized heap memory
* Activities: Allocate heap memory, fill with a non-zero value, free it, allocate it again in a deterministic way to get the same heap region, and read back the contents
* Verdict: Memory contents are all zero on second call => PASS, otherwise FAIL
* Preparation: Define initialization value to be zero or one
* Activities: Allocate heap memory, fill with a non-initialization value, free it, allocate it again in a deterministic way to get the same heap region, and read back the contents
* Verdict: Memory contents are all initialization value on second call => PASS, otherwise FAIL
* Evidence: Contents of allocated memory before the free, contents of allocated memory after second allocation

### 5.2.3 ER-LMII: Limit incident impact