Skip to content

Commit 421f5d2

Browse files
Merge pull request #1548 from minosgalanakis/public-mbedtls-4.1
Merge public changes into internal LTS 4.1 branch
2 parents 0cfd964 + 521d2eb commit 421f5d2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

ChangeLog.d/security-advice.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Security
2+
* Added advice about compiler options in SECURITY.md.

SECURITY.md

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

108108
### Caveats
109109

110+
#### Compiler-induced side channels
111+
112+
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.
113+
114+
We recommend compiling Mbed TLS with commonly used levels of optimizations, such as `-O2` or `-Os`. We will generally treat exploitable timing side channels as a vulnerability if they appear with a common compiler at a common level of optimization. Higher levels of optimization such as `-O3` or `-Oz` are still likely to be safe but are less scrutinized. We do not recommend using individual options that might introduce data-dependent timing, and we will not try to work around such optimizations if they are not part of a commonly used level.
115+
110116
#### Out-of-scope countermeasures
111117

112118
Mbed TLS has evolved organically and a well defined threat model hasn't always

0 commit comments

Comments
 (0)