diff options
author | Lucas Duarte Prates <lucas.prates@arm.com> | 2024-06-20 10:22:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 10:22:01 +0100 |
commit | 78ff617d3f573fb3a9b2fef180fa0fd43d5584ea (patch) | |
tree | bf866de2bf99817d9b7441dd90cb439c9f044c5b /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | d594d9f7f4dc6eb748b3261917db689fdc348b96 (diff) | |
download | llvm-78ff617d3f573fb3a9b2fef180fa0fd43d5584ea.zip llvm-78ff617d3f573fb3a9b2fef180fa0fd43d5584ea.tar.gz llvm-78ff617d3f573fb3a9b2fef180fa0fd43d5584ea.tar.bz2 |
[ARM] CMSE security mitigation on function arguments and returned values (#89944)
The ABI mandates two things related to function calls:
- Function arguments must be sign- or zero-extended to the register
size by the caller.
- Return values must be sign- or zero-extended to the register size by
the callee.
As consequence, callees can assume that function arguments have been
extended and so can callers with regards to return values.
Here lies the problem: Nonsecure code might deliberately ignore this
mandate with the intent of attempting an exploit. It might try to pass
values that lie outside the expected type's value range in order to
trigger undefined behaviour, e.g. out of bounds access.
With the mitigation implemented, Secure code always performs extension
of values passed by Nonsecure code.
This addresses the vulnerability described in CVE-2024-0151.
Patches by Victor Campos.
---------
Co-authored-by: Victor Campos <victor.campos@arm.com>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions