From a59dd80f9f48cb750d329d4d4af2d99d72b484d1 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Wed, 2 Jul 2014 16:28:08 -0700 Subject: Runtime can now be set to require relocation Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force the runtime to require that all files that are run are relocated, to prevent attacks based on the known art base address. Add support for running patchoat on oat files compiled without an image. Change run-test to have new --prebuild and --relocate flags. Bug: 15358152 Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d --- runtime/oat.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/oat.h') diff --git a/runtime/oat.h b/runtime/oat.h index fbed596..6d5fefe 100644 --- a/runtime/oat.h +++ b/runtime/oat.h @@ -88,6 +88,10 @@ class PACKED(4) OatHeader { uint32_t GetQuickToInterpreterBridgeOffset() const; void SetQuickToInterpreterBridgeOffset(uint32_t offset); + int32_t GetImagePatchDelta() const; + void RelocateOat(off_t delta); + void SetImagePatchDelta(int32_t off); + InstructionSet GetInstructionSet() const; const InstructionSetFeatures& GetInstructionSetFeatures() const; uint32_t GetImageFileLocationOatChecksum() const; @@ -129,6 +133,9 @@ class PACKED(4) OatHeader { uint32_t quick_resolution_trampoline_offset_; uint32_t quick_to_interpreter_bridge_offset_; + // The amount that the image this oat is associated with has been patched. + int32_t image_patch_delta_; + uint32_t image_file_location_oat_checksum_; uint32_t image_file_location_oat_data_begin_; -- cgit v1.1