RFR: JDK-8297242: Use-after-free during library unloading on Linux

Justin King jcking at openjdk.org
Mon Nov 21 04:22:53 UTC 2022


On Sun, 20 Nov 2022 21:19:11 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> ASan identified a use-after-free in `os::dll_unload` caused by referencing memory owned by the dynamic loader after closing the library.
>
> src/hotspot/os/posix/os_posix.cpp line 724:
> 
>> 722:   const char* l_path = NULL;
>> 723:   char* l_pathdup = NULL;
>> 724:   LINUX_ONLY(
> 
> The XXX_ONLY macros are intended for one-liners or in-line conditionals. For a block please use `#ifdef LINUX`.

Ah, thanks for the correction. Was not sure. Fixed.

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

PR: https://git.openjdk.org/jdk/pull/11231


More information about the hotspot-runtime-dev mailing list