RFR: 8275846: read_base_archive_name() could read past the end of buffer [v3]

Ioi Lam iklam at openjdk.java.net
Sun Nov 7 21:20:09 UTC 2021


> Please review this small fix for an intermittent crash in `FileHeaderHelper::read_base_archive_name()`. The crash happens if a string stored inside a CDS dynamic archive is not zero-terminated.
> 
> The fix is to check for zero-termination, and that the actual string length matches with the the recorded length.
> 
> This fix was authored by @yqi in PR #5997 , but that PR may take longer to integrate than expected. So let's fix the crash first.

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' of https://github.com/openjdk/jdk into 8275846-read_base_archive_name-past-end-buffer
 - Added new test case where base archive does not exist
 - remove unnecessary type cast
 - 8275846: read_base_archive_name() could read past the end of buffer

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6285/files
  - new: https://git.openjdk.java.net/jdk/pull/6285/files/59b9721b..795c5018

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6285&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6285&range=01-02

  Stats: 539 lines in 20 files changed: 464 ins; 23 del; 52 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6285/head:pull/6285

PR: https://git.openjdk.java.net/jdk/pull/6285


More information about the hotspot-runtime-dev mailing list