summaryrefslogtreecommitdiffstats
path: root/Documentation/security
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2020-05-06 10:55:12 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-06-17 09:17:56 +0000
commit41fec869fb3b25fd5bb5b454ab1bf39660ce314d (patch)
tree914ae7cef0e1b90e2173d62f3698a8e30a9a1655 /Documentation/security
parentc59d9e3917a4d30d74d64c8210ed3a516b269534 (diff)
downloadcoreboot-41fec869fb3b25fd5bb5b454ab1bf39660ce314d.tar.gz
coreboot-41fec869fb3b25fd5bb5b454ab1bf39660ce314d.tar.bz2
coreboot-41fec869fb3b25fd5bb5b454ab1bf39660ce314d.zip
cpu/x86/smm: Add helper functions to verify SMM access
* Add a function to check if a region overlaps with SMM. * Add a function to check if a pointer points to SMM. * Document functions in Documentation/security/smm To be used to verify data accesses in SMM. Change-Id: Ia525d2bc685377f50ecf3bdcf337a4c885488213 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Christian Walter <christian.walter@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41084 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'Documentation/security')
-rw-r--r--Documentation/security/index.md4
-rw-r--r--Documentation/security/smm.md29
2 files changed, 33 insertions, 0 deletions
diff --git a/Documentation/security/index.md b/Documentation/security/index.md
index d5d4e2b93efd..c9cb4a77de26 100644
--- a/Documentation/security/index.md
+++ b/Documentation/security/index.md
@@ -13,3 +13,7 @@ This section describes documentation about the security architecture of coreboot
- [Intel TXT in general](intel/txt.md)
- [Intel TXT Initial Boot Block](intel/txt_ibb.md)
- [Intel Authenticated Code Modules](intel/acm.md)
+
+## SMM
+
+- [System Management Mode](smm.md)
diff --git a/Documentation/security/smm.md b/Documentation/security/smm.md
new file mode 100644
index 000000000000..4e95427b8662
--- /dev/null
+++ b/Documentation/security/smm.md
@@ -0,0 +1,29 @@
+# x86 System Managment Mode
+
+## Introduction
+
+The code running in System Management Mode (SMM) provides runtime services
+to applications running in [ring0]. It has a higher privilege level than
+[ring0] and resides in the SMRAM region which cannot be accessed from [ring0].
+
+SMM can be entered by issuing System Managment Interrupts (SMIs).
+
+## Secure data exchange
+
+In order to not leak SMM internals or accidentally overwrite parts of SMM,
+[ring0] provided data (pointers, offsets, sizes, ...) must be checked before
+using them in SMM.
+
+There exist two methods to verify data:
+
+```C
+/* Returns true if the region overlaps with the SMM */
+bool smm_region_overlaps_handler(struct region *r);
+```
+
+```C
+/* Returns true if the memory pointed to overlaps with SMM reserved memory. */
+static inline bool smm_points_to_smram(const void *ptr, const size_t len);
+```
+
+[ring0]: https://en.wikipedia.org/wiki/Protection_ring