From c244c21573689bb8fa4b389f909b9f77dd9f2f9a Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Thu, 10 Jan 2019 09:46:52 -0800 Subject: [PATCH] Enable execute-only memory layouts by default. This enables execute-only memory (XOM) layouts to be used by default in the build system. As of now, there's only support for ARM64 devices, so this only affects those. Since userland XOM requires kernel support, devices without the necessary support will continue to allow pages marked execute-only to be read and they should be unaffected by this. Bug: 77958880 Test: Device with and without kernel support boot. Test: Binary throws segfault when reading from XOM on supported device. Test: Debugger works and stack traces are still generated correctly. Test: Teamfooding, stable during regular usage. Change-Id: I8db4235c8e60eea6d701bdf3c43b79a06d6b01cd --- core/binary.mk | 2 +- core/soong_config.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index be10c2d37b..df0e1a5019 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -76,7 +76,7 @@ ifneq ($(NATIVE_COVERAGE),true) my_native_coverage := false endif -ifeq ($(strip $(ENABLE_XOM)),true) +ifneq ($(strip $(ENABLE_XOM)),false) ifndef LOCAL_IS_HOST_MODULE my_xom := true # Disable XOM in excluded paths. diff --git a/core/soong_config.mk b/core/soong_config.mk index 77329c35f5..2363f2b167 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -83,7 +83,7 @@ $(call add_json_bool, Safestack, $(filter true,$(USE_SAF $(call add_json_bool, EnableCFI, $(call invert_bool,$(filter false,$(ENABLE_CFI)))) $(call add_json_list, CFIExcludePaths, $(CFI_EXCLUDE_PATHS) $(PRODUCT_CFI_EXCLUDE_PATHS)) $(call add_json_list, CFIIncludePaths, $(CFI_INCLUDE_PATHS) $(PRODUCT_CFI_INCLUDE_PATHS)) -$(call add_json_bool, EnableXOM, $(filter true,$(ENABLE_XOM))) +$(call add_json_bool, EnableXOM, $(call invert_bool,$(filter false,$(ENABLE_XOM)))) $(call add_json_list, XOMExcludePaths, $(XOM_EXCLUDE_PATHS) $(PRODUCT_XOM_EXCLUDE_PATHS)) $(call add_json_list, IntegerOverflowExcludePaths, $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))