[libunwind] [libunwind][AArch64] Protect PC within libunwind's context. (PR #113368)
John Brawn via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 06:17:38 PDT 2024
================
@@ -1845,8 +1884,14 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
uint64_t getSP() const { return _registers.__sp; }
void setSP(uint64_t value) { _registers.__sp = value; }
- uint64_t getIP() const { return _registers.__pc; }
- void setIP(uint64_t value) { _registers.__pc = value; }
+ uint64_t getIP() const { return auth(_registers.__pc, getAuthSalt()); }
+ void setIP(uint64_t value) {
+ // First authenticate the current value of the IP to ensure the context
+ // is still valid. This also ensure the setIP can't be used for signing
----------------
john-brawn-arm wrote:
"ensure the" should be "ensures that"
https://github.com/llvm/llvm-project/pull/113368
More information about the cfe-commits
mailing list