Repository navigation
bound chunk dimension count in H5P__dcrt_layout_dec - #6724
Open
naruto-lgtm wants to merge 1 commit into
Open
naruto-lgtm wants to merge 1 commit into
naruto-lgtm wants to merge 1 commit into
Conversation
naruto-lgtm
requested review from
fortnern,
glennsong09,
hyoklee,
jhendersonHDF,
lrknox,
mattjala and
vchoi-hdfgroup
as code owners
October 9, 2026 20:19
github-actions
Bot
removed request for
fortnern,
glennsong09,
lrknox,
mattjala and
vchoi-hdfgroup
October 9, 2026 20:26
Contributor
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
hyoklee
approved these changes
Oct 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Cause:
H5P__dcrt_layout_dec()decodes a chunked layout from an encoded property list (reached from the publicH5Pdecode()). It reads the chunk rank as a single byte and only rejects zero, then writes that many dimensions intotmp_layout.u.chunk.dim[], a fixed array ofH5O_LAYOUT_NDIMS(33) entries. A rank above that count overruns the stack struct and runs past the end of the input buffer. The object header layout message decoder (H5O__layout_decode()) already rejectsndims > H5O_LAYOUT_NDIMS; the property-list decoder did not.Fix: reject a rank greater than
H5O_LAYOUT_NDIMSbefore the decode loop, keeping the bound in the decoder where the untrusted count is consumed.Repro: with ASan,
H5Pdecode()on an encoded DCPL whose chunk-rank byte is set to 200 faults with a heap-buffer-overflow inH5P__dcrt_layout_dec(); after the change the same buffer is rejected with an error. A regression test covering this is added totest/enc_dec_plist.c.Issue ticket number (GitHub or JIRA)
N/A
Checklist before requesting a review