• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修訂8ccc1ad0f71d0587edfbc4c637d6d8de196fe7df (tree)
時間2016-06-24 06:45:35
作者Andreas Gampe <agampe@goog...>
CommiterAndreas Gampe

Log Message

Rootdir: Add more asan.options support

Extend the asan.options file to read binary-specific configuration
from files out of /system. For early services, the system image
location is important as /data may not be available when they are
started.

Add a template that turns most sanitization off. At this point in
time, it is, however, impossible to get to a zero overhead state
after the fact. The template is meant to adapt a build after the
fact, and work around issues with LOCAL_SANITIZE := never.

Add a Make variable and rule copying the template to the path and
name expected by ASAN. Add SANITIZE_LITE to automatically add a
large set of options files.

Bug: 29498013
Change-Id: I8e9e6929a55cee3f3fa0acb377a886bfa7006c91

Change Summary

差異

--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -26,6 +26,7 @@ include $(BUILD_PREBUILT)
2626 #######################################
2727 # asan.options
2828 ifneq ($(filter address,$(SANITIZE_TARGET)),)
29+
2930 include $(CLEAR_VARS)
3031
3132 LOCAL_MODULE := asan.options
@@ -34,6 +35,72 @@ LOCAL_SRC_FILES := $(LOCAL_MODULE)
3435 LOCAL_MODULE_PATH := $(TARGET_OUT)
3536
3637 include $(BUILD_PREBUILT)
38+
39+# Modules for asan.options.X files.
40+
41+ASAN_OPTIONS_FILES :=
42+
43+define create-asan-options-module
44+include $$(CLEAR_VARS)
45+LOCAL_MODULE := asan.options.$(1)
46+ASAN_OPTIONS_FILES += asan.options.$(1)
47+LOCAL_MODULE_CLASS := ETC
48+# The asan.options.off.template tries to turn off as much of ASAN as is possible.
49+LOCAL_SRC_FILES := asan.options.off.template
50+LOCAL_MODULE_PATH := $(TARGET_OUT)
51+include $$(BUILD_PREBUILT)
52+endef
53+
54+# Pretty comprehensive set of native services. This list is helpful if all that's to be checked is an
55+# app.
56+ifeq ($(SANITIZE_LITE),true)
57+SANITIZE_ASAN_OPTIONS_FOR := \
58+ adbd \
59+ ATFWD-daemon \
60+ audioserver \
61+ bridgemgrd \
62+ cameraserver \
63+ cnd \
64+ debuggerd \
65+ debuggerd64 \
66+ dex2oat \
67+ drmserver \
68+ fingerprintd \
69+ gatekeeperd \
70+ installd \
71+ keystore \
72+ lmkd \
73+ logcat \
74+ logd \
75+ lowi-server \
76+ media.codec \
77+ mediadrmserver \
78+ media.extractor \
79+ mediaserver \
80+ mm-qcamera-daemon \
81+ mpdecision \
82+ netmgrd \
83+ perfd \
84+ perfprofd \
85+ qmuxd \
86+ qseecomd \
87+ rild \
88+ sdcard \
89+ servicemanager \
90+ slim_daemon \
91+ surfaceflinger \
92+ thermal-engine \
93+ time_daemon \
94+ update_engine \
95+ vold \
96+ wpa_supplicant \
97+ zip
98+endif
99+
100+ifneq ($(SANITIZE_ASAN_OPTIONS_FOR),)
101+ $(foreach binary, $(SANITIZE_ASAN_OPTIONS_FOR), $(eval $(call create-asan-options-module,$(binary))))
102+endif
103+
37104 endif
38105
39106 #######################################
@@ -47,7 +114,7 @@ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
47114 EXPORT_GLOBAL_ASAN_OPTIONS :=
48115 ifneq ($(filter address,$(SANITIZE_TARGET)),)
49116 EXPORT_GLOBAL_ASAN_OPTIONS := export ASAN_OPTIONS include=/system/asan.options
50- LOCAL_REQUIRED_MODULES := asan.options
117+ LOCAL_REQUIRED_MODULES := asan.options $(ASAN_OPTIONS_FILES)
51118 endif
52119 # Put it here instead of in init.rc module definition,
53120 # because init.rc is conditionally included.
--- a/rootdir/asan.options
+++ b/rootdir/asan.options
@@ -3,3 +3,4 @@ detect_odr_violation=0
33 alloc_dealloc_mismatch=0
44 allocator_may_return_null=1
55 detect_container_overflow=0
6+include_if_exists=/system/asan.options.%b
--- /dev/null
+++ b/rootdir/asan.options.off.template
@@ -0,0 +1,7 @@
1+quarantine_size_mb=0
2+max_redzone=16
3+poison_heap=false
4+poison_partial=false
5+poison_array_cookie=false
6+alloc_dealloc_mismatch=false
7+new_delete_type_mismatch=false