diff options
author | dimitry <dimitry@google.com> | 2018-04-27 12:19:07 +0200 |
---|---|---|
committer | dimitry <dimitry@google.com> | 2018-04-27 21:19:33 +0200 |
commit | 94f7a87510138ac7b061611b181fa6e995d41764 (patch) | |
tree | 9a17846ce15203b3ab2a25f094907448ae986a95 | |
parent | 592bf711fdf273ff8a61b32e12cd886897922335 (diff) | |
download | bionic-94f7a87510138ac7b061611b181fa6e995d41764.tar.gz |
Libraries without dt_soname are inaccessible
When linker tries to check if a library without dt_soname is accessible
it crashes. This change fixes this problem to return false instead
(making them inaccessible from other namespaces)
This went unnoticed because vendor libraries on current
devices all have dt_soname set. This was only discovered
on one of the newer devices which has a vendor prebuilt
library without a soname.
Bug: http://b/78661414
Bug: https://issuetracker.google.com/77287902
Test: cts-tradefed run commandAndExit cts -m CtsJniTestCases
Change-Id: Idb192b4ed7a810840ba2a9177bad2360ffbb75e2
-rw-r--r-- | linker/linker_namespaces.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linker/linker_namespaces.h b/linker/linker_namespaces.h index 03520d79d..cd8b09d96 100644 --- a/linker/linker_namespaces.h +++ b/linker/linker_namespaces.h @@ -54,6 +54,9 @@ struct android_namespace_link_t { } bool is_accessible(const char* soname) const { + if (soname == nullptr) { + return false; + } return allow_all_shared_libs_ || shared_lib_sonames_.find(soname) != shared_lib_sonames_.end(); } |