summaryrefslogtreecommitdiff
path: root/linker/linker_namespaces.cpp
diff options
context:
space:
mode:
authorDimitry Ivanov <dimitry@google.com>2017-04-11 15:22:49 -0700
committerDimitry Ivanov <dimitry@google.com>2017-04-12 10:37:31 -0700
commitd3a07e84a7fdf08a4f68f4549cd2a815418ae746 (patch)
tree9edaeaab59e68463ca70425ba7c959517e40cab0 /linker/linker_namespaces.cpp
parentfaf7f3542a1b7c850450df158072f021537f40c1 (diff)
The workaround for apps using older version of soinfos
Skip the check for accessibility in the case soinfo does not have primary/secondary namespaces associated with them. Bug: http://b/37191433 Test: start an app from http://b/37191433 make sure it does not crash on lunch Change-Id: Id4c0bdab4dfc6bc8a33fc275d71e325518e0759f (cherry picked from commit 97b4c5f2649db06661e45147f21a2ab26340ad89)
Diffstat (limited to 'linker/linker_namespaces.cpp')
-rw-r--r--linker/linker_namespaces.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/linker/linker_namespaces.cpp b/linker/linker_namespaces.cpp
index 273ff9b69..3c86f9984 100644
--- a/linker/linker_namespaces.cpp
+++ b/linker/linker_namespaces.cpp
@@ -27,6 +27,7 @@
*/
#include "linker_namespaces.h"
+#include "linker_globals.h"
#include "linker_soinfo.h"
#include "linker_utils.h"
@@ -58,6 +59,13 @@ bool android_namespace_t::is_accessible(const std::string& file) {
bool android_namespace_t::is_accessible(soinfo* s) {
auto is_accessible_ftor = [this] (soinfo* si) {
+ // This is workaround for apps hacking into soinfo list.
+ // and inserting their own entries into it. (http://b/37191433)
+ if (!si->has_min_version(3)) {
+ DL_WARN("invalid soinfo version for \"%s\"", si->get_soname());
+ return false;
+ }
+
if (si->get_primary_namespace() == this) {
return true;
}