Skip to content

Commit ecec135

Browse files
Add a section about compiler-introduced timing side channels
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent 426f860 commit ecec135

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

SECURITY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ model, they need to be mitigated by physical countermeasures.
104104

105105
### Caveats
106106

107+
#### Compiler-induced side channels
108+
109+
Mbed TLS is mostly written in C. We use standard C except with known compilers, so we do not expect compilers to introduce direct vulnerabilities. However, compilers can introduce [timing side channels](#timing-attacks) in code that was intended to be constant-time. Mbed TLS includes countermeasures to try to prevent this. But given the diversity of compilers, compiler options and target platforms, this prevention may not be complete.
110+
111+
We recommend compiling Mbed TLS with commonly used levels of optimizations, such as `-O2` or `-Os`. Higher levels of optimization such as `-O3` or `-Oz` are likely to be safe but are less scrutinized. We do not recommend using less vetted optimization options unless your system is physically isolated.
112+
107113
#### Out-of-scope countermeasures
108114

109115
TF-PSA-Crypto has evolved organically and a well defined threat model hasn't

0 commit comments

Comments
 (0)