From c7c2d7bcd471c44ff18d19201eacaa17475584d5 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 21 Apr 2017 17:18:45 -0700 Subject: [PATCH] Linker: Add ASAN support to treble ld.config Add asan counterparts. Bug: 37579959 Test: m && m SANITIZE_TARGET=address Merged-in: I23f05436b79fbcb3f6fa11d84c95fcd180fad3b3 Change-Id: I23f05436b79fbcb3f6fa11d84c95fcd180fad3b3 --- rootdir/etc/ld.config.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index 1ec2bc019..cbe208080 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt @@ -21,12 +21,18 @@ namespace.default.isolated = false namespace.default.search.paths = /system/${LIB}:/vendor/${LIB} namespace.default.permitted.paths = /system/${LIB}:/vendor/${LIB} +namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB} +namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB} + # TODO(b/37013858): remove all dependencies to /vendor/lib from system processes # When this is done, comment out following three lines and remove the three # lines above #namespace.default.isolated = true #namespace.default.search.paths = /system/${LIB} #namespace.default.permitted.paths = /system/${LIB} +# +#namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB} +#namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB} ############################################################################### # "sphal" namespace @@ -46,6 +52,9 @@ namespace.sphal.visible = true namespace.sphal.search.paths = /vendor/${LIB}/egl:/vendor/${LIB}/hw:/vendor/${LIB} namespace.sphal.permitted.paths = /vendor/${LIB} +namespace.sphal.asan.search.paths = /data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}:/vendor/${LIB} +namespace.sphal.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB} + # Once in this namespace, access to libraries in /system/lib is restricted. Only # libs listed here can be used. namespace.sphal.links = default,vndk @@ -69,6 +78,9 @@ namespace.vndk.isolated = true namespace.vndk.search.paths = /vendor/${LIB}/vndk-sp:/vendor/${LIB} namespace.vndk.permitted.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl +namespace.vndk.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/vendor/${LIB}:/vendor/${LIB} +namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl + # When these NDK libs are required inside this namespace, then it is redirected # to the default namespace. This is possible since their ABI is stable across # Android releases. @@ -85,3 +97,5 @@ namespace.vndk.link.default.shared_libs = libc.so:libz.so:libm.so:libdl.so:libst [vendor] namespace.default.isolated = false namespace.default.search.paths = /vendor/${LIB}:/vendor/${LIB}/vndk-sp:/system/${LIB} + +namespace.default.asan.search.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}:/system/${LIB}