From 2c498a391b29a1e84c71040f3f656e5cad5543a0 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 30 Mar 2017 16:54:23 -0700 Subject: [PATCH] Build: Force system owner for ASAN in system For tar-ed ASAN artifacts, enforce ownership by the system uid. Bug: 36458146 Test: m && m SANITIZE_TARGET=true SANITIZE_TARGET_SYSTEM=true Change-Id: I190cba3d160f15a89ef74f26e7aaa853a449929f --- core/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 2ef9842bec..510cd9817a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1485,10 +1485,12 @@ ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL := $(sort $(patsubst $(PRODUCT_OUT)/%,%,\ $(2ND_TARGET_OUT_SHARED_LIBRARIES) \ $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) \ $(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES))) +# Extra options: Enforce the system user for the files to avoid having to change ownership. +ASAN_SYSTEM_INSTALL_OPTIONS := --owner=1000 --group=1000 # Note: experimentally, it seems not worth it to try to get "best" compression. We don't save # enough space. $(ASAN_IN_SYSTEM_INSTALLED): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS) - tar cfj $(ASAN_IN_SYSTEM_INSTALLED) -C $(TARGET_OUT_DATA)/.. $(ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null + tar cfj $(ASAN_IN_SYSTEM_INSTALLED) $(ASAN_SYSTEM_INSTALL_OPTIONS) -C $(TARGET_OUT_DATA)/.. $(ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null ####### ## data partition tarball