Integrated: 8358289: [asan] runtime/cds/appcds/aotCode/AOTCodeFlags.java reports heap-buffer-overflow in ArchiveBuilder

Vladimir Kozlov kvn at openjdk.org
Wed Jun 4 02:17:29 UTC 2025


On Tue, 3 Jun 2025 02:01:02 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> There is difference between AdapterFingerPrint allocation size [compute_size](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2227) which may not be aligned to HeapWord size and [size](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2421) used for copying during AOT cache build which is aligned and can be bigger than allocation size. 
> 
> I added asserts to `AdapterFingerPrint` and `AdapterHandlerEntry` to make sure sizes are correct. Both are used in AOT cache build.
> 
> I also moved `FreeHeap()` from `~AdapterFingerPrint()` to enforce the comment and simplify executed code.
> 
> Thanks to @MBaesken for finding the issue and @iklam for pointing the cause.
> 
> Testing tier1-3, xcomp, stress. Higher tiers are still running.

This pull request has now been integrated.

Changeset: ebd85288
Author:    Vladimir Kozlov <kvn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/ebd85288ce309b7dc7ff8b36558dd9f2a2300209
Stats:     15 lines in 2 files changed: 5 ins; 1 del; 9 mod

8358289: [asan] runtime/cds/appcds/aotCode/AOTCodeFlags.java reports heap-buffer-overflow in ArchiveBuilder

Reviewed-by: shade, iklam, asmehra

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

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


More information about the hotspot-dev mailing list