8382428: libsyslookup.so is not needed for Linux#30794
8382428: libsyslookup.so is not needed for Linux#30794YaSuenag wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back ysuenaga! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
Why do you think |
For security.
I could not understand this case.
Indeed, but this concern already exists because the user can issue |
Right, and the library we load for that is libsyslookup. The default lookup should not expose some arbitrary set of symbols, but something we have some control over. That's the whole reason why we use libsyslookup in the first place. We have no control (or at least much less) over the symbols returned by |
|
I think this comes down to the question of which option is "risky" in security POV. I understand it is better to control library dependencies, but it could be "uncontrollable" eventually if the user tried to use FFM. Thus I think it make sence to remove libsyslookup to prevent attacks relates to library like DLL hijack. |
Not sure what you mean here. We control libsyslookup.
Sorry, but I'm not convinced by this argument at all. The JVM uses dozens of other native libraries. Heck, even the JVM itself is a library. I see no reason why having another library would be a problem. |
|
@JornVernee I understood shim library (libsyslookup) was approved to ensure it does not include more symbols than necessary. |
SystemLookupin FFM uses libsyslookup to find symbols from the system. But it is not needed becauseRTLD_DEFAULTcan be used for this purpose on Linux.Removing unneeded library improves security.
I've sent email to core-libs-dev, but I've not yet received any comments, so I created this PR.
syslookup.dll for Windows is needed because some functions might not be lookup'ed. OTOH on Linux,
dlsymcan lookup symbols from library dependencies. InSystemLookup, handle of libsyslookup would be passed todlsymeventually, but it is better to passRTLD_DEFAULTin this case.It works when the handle of libsyslookup is passed, but
RTLD_DEFAULTis better because Javadoc ofLinker::defaultLookupsays it returns a set of commonly used libraries.In addition, I guess we can apply this change to all of POSIX platforms because
dlsymis defined in POSIX, but I'm not sure we can do (especially AIX - it has own syslookup.c in JDK source tree).This change passed all of jdk_foreign tests.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30794/head:pull/30794$ git checkout pull/30794Update a local copy of the PR:
$ git checkout pull/30794$ git pull https://git.openjdk.org/jdk.git pull/30794/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30794View PR using the GUI difftool:
$ git pr show -t 30794Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30794.diff
Using Webrev
Link to Webrev Comment