RFR: 8358597: [asan] Buffer overflow in ArchiveBuilder::make_shallow_copy with Symbols

Ioi Lam iklam at openjdk.org
Fri Sep 26 02:39:46 UTC 2025


The bug: when Symbols are copied into the dynamic CDS archive, extra padding bytes may be copied, which triggers "buffer overflow" errors in asan.

The fix is to copy the exact number of bytes for Symbols.

Since `ArchiveBuilder::make_shallow_copy()` deals with different alignments and sizes, I renamed the variables and added comments/asserts to make the code more readable.

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

Commit messages:
 - More clean up
 - 8358597: [asan] Buffer overflow in ArchiveBuilder::make_shallow_copy with Symbols

Changes: https://git.openjdk.org/jdk/pull/27508/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27508&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8358597
  Stats: 21 lines in 1 file changed: 10 ins; 2 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/27508.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27508/head:pull/27508

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


More information about the hotspot-runtime-dev mailing list