diff options
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 706660085..82d0d9eb6 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1582,9 +1582,6 @@ static int open_library(android_namespace_t* ns, } } - if (fd != -1 && !ns->is_accessible(*realpath)) { - fd = -1; - } return fd; } @@ -1701,6 +1698,13 @@ static bool load_library(android_namespace_t* ns, return false; } + if (!ns->is_accessible(realpath)) { + // do not load libraries if they are not accessible for the specified namespace. + DL_ERR("library \"%s\" is not accessible for the namespace \"%s\"", + name, ns->get_name()); + return false; + } + soinfo* si = soinfo_alloc(ns, realpath.c_str(), &file_stat, file_offset, rtld_flags); if (si == nullptr) { return false; |