From e5373c702c502f9efcddf9dd7af9f910434de544 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 15 Mar 2023 14:29:53 -0700 Subject: [PATCH] cuttlefish: Add a fullmte target. Bug: 273575148 Change-Id: I3f6a4a3516a44b44e83a50475fbd820ddd1a2f08 --- target/product/fullmte.mk | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 target/product/fullmte.mk diff --git a/target/product/fullmte.mk b/target/product/fullmte.mk new file mode 100644 index 0000000000..d47c685584 --- /dev/null +++ b/target/product/fullmte.mk @@ -0,0 +1,26 @@ +# +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Enables more comprehensive detection of memory errors on hardware that +# supports the ARM Memory Tagging Extension (MTE), by building the image with +# MTE stack instrumentation and forcing MTE on in SYNC mode in all processes. +# For more details, see: +# https://source.android.com/docs/security/test/memory-safety/arm-mte +ifeq ($(filter memtag_heap,$(SANITIZE_TARGET)),) + SANITIZE_TARGET := $(strip $(SANITIZE_TARGET) memtag_heap memtag_stack) + SANITIZE_TARGET_DIAG := $(strip $(SANITIZE_TARGET_DIAG) memtag_heap) +endif +PRODUCT_PRODUCT_PROPERTIES += persist.arm64.memtag.default=sync