1 // Copyright 2020 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_EXECUTION_POINTER_AUTHENTICATION_DUMMY_H_ 6 #define V8_EXECUTION_POINTER_AUTHENTICATION_DUMMY_H_ 7 8 #include "src/execution/pointer-authentication.h" 9 10 #include "include/v8.h" 11 #include "src/base/macros.h" 12 #include "src/common/globals.h" 13 14 namespace v8 { 15 namespace internal { 16 17 // Dummy implementation of the PointerAuthentication class methods, to be used 18 // when CFI is not enabled. 19 20 // Load return address from {pc_address} and return it. AuthenticatePC(Address * pc_address,unsigned offset_from_sp)21V8_INLINE Address PointerAuthentication::AuthenticatePC( 22 Address* pc_address, unsigned offset_from_sp) { 23 USE(offset_from_sp); 24 return *pc_address; 25 } 26 27 // Return {pc} unmodified. StripPAC(Address pc)28V8_INLINE Address PointerAuthentication::StripPAC(Address pc) { return pc; } 29 30 // Store {new_pc} to {pc_address} without signing. ReplacePC(Address * pc_address,Address new_pc,int offset_from_sp)31V8_INLINE void PointerAuthentication::ReplacePC(Address* pc_address, 32 Address new_pc, 33 int offset_from_sp) { 34 USE(offset_from_sp); 35 *pc_address = new_pc; 36 } 37 38 // Return {pc} unmodified. SignAndCheckPC(Address pc,Address sp)39V8_INLINE Address PointerAuthentication::SignAndCheckPC(Address pc, 40 Address sp) { 41 USE(sp); 42 return pc; 43 } 44 45 } // namespace internal 46 } // namespace v8 47 48 #endif // V8_EXECUTION_POINTER_AUTHENTICATION_DUMMY_H_ 49