OSDN Git Service

Do not allow System.load() of external libraries
authorDimitry Ivanov <dimitry@google.com>
Fri, 29 Jan 2016 01:24:20 +0000 (17:24 -0800)
committerDimitry Ivanov <dimitry@google.com>
Fri, 29 Jan 2016 01:49:49 +0000 (17:49 -0800)
commit1005748da1ee257f4ba64a4ef1cae7ce05bdf946
tree642932207a656de173ce74e9acfd0c1ba6472817
parent9a020b1ff0073ebc7c0139ffe7be6eb69d4510c8
Do not allow System.load() of external libraries

The greylisting mechanism had a bug that allowed
loading any library using absolute path from java code.

It mistakenly assumed they are needed by greylisted
system library when in fact it is dlopen() call from
libnativeloader.

This patch fixes this problem by checking that the library is in
fact dt_needed and it is not a dlopen call.

Bug: http://b/26394120
Bug: http://b/22548808
Change-Id: Ia3d4c19e77b04d09a6c3047d684d0c04bd5c785e
linker/linker.cpp