RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Oct 8 21:32:12 UTC 2021


On Fri, 8 Oct 2021 04:43:08 GMT, Cheng Jin <github.com+18036229+ChengJin01 at openjdk.org> wrote:

> So I am wondering what happened to the system lookup in such case given there should be no fundamental difference in leveraging `NativeLibraries` (I assume the library loading in OpenJDK16 & 17 is the same at this point) unless there is something else new in OpenJDK17 I am unaware of (e.g. the changes in `Lib.gmk` or `lib-std.m4`, or a custom system lookup is required on AIX, etc). Thanks.

In 17, SystemLookup loads a specific library that is generated at build time - which contains all the c stdlib symbols. That's what the Lib.gmk changes are for. What I suspect is that the library is not generated at all, or not correctly on AIX, which then causes the system lookup to misbehave.

I would start by double checking that you have a file like this:

<JDK_ROOT>/lib/libsyslookup.so

And then, if the library exists, check that it has the right dependency; on my linux it's an empty library, but which depends on libc, libm and libdl:


ldd lib/libsyslookup.so  
	linux-vdso.so.1 (0x00007fff2bdf7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f35f1def000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f35f1ca0000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f35f1c9a000)

-------------

PR: https://git.openjdk.java.net/jdk/pull/4316


More information about the security-dev mailing list