RFR: 8358632: [asan] reports heap-buffer-overflow in AOTCodeCache::copy_bytes

Vladimir Kozlov kvn at openjdk.org
Thu Jun 5 00:25:09 UTC 2025


AOTCodeCache::copy_bytes() tries to optimize by copying byte buffer using HeapWords (64bits) by rounding up the size which may access memory after buffer.

We should use memcpy() instead.

I also fixed output match pattern in test because oop base address is hexadecimal value. I fixed in in leyden/premain branch and forgot to port into mainline. During testing the fix I hit this issue.

Testing tier1-3,xcomp,stress

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

Commit messages:
 - 8358632: [asan] reports heap-buffer-overflow in AOTCodeCache::copy_bytes

Changes: https://git.openjdk.org/jdk/pull/25651/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25651&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8358632
  Stats: 13 lines in 2 files changed: 0 ins; 9 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/25651.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25651/head:pull/25651

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


More information about the hotspot-dev mailing list