Skip to content

Conversation

bmribler
Copy link
Collaborator

@bmribler bmribler commented Nov 6, 2024

A decoded length appeared to be corrupted and had a very large value.
This PR added a check to detect such potential data corruption.

The fuzzer file is in the cve_hdf5 repo.

Fixes GH-4431

bmribler and others added 2 commits November 6, 2024 02:58
A decoded length appeared to be corrupted and had a very large value.
This PR added a check to detect such potential data corruption.
@bmribler bmribler added Priority - 1. High 🔼 Component - C Library Core C library issues (usually in the src directory) Type - Security Security issues, including library crashers and memory leaks labels Nov 6, 2024
Copy link
Collaborator

@qkoziol qkoziol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost certainly, the cache is not the problem.

What kind of entry's "get_load_size" callback is being invoked to create the corrupted length?

@bmribler
Copy link
Collaborator Author

bmribler commented Nov 6, 2024

Almost certainly, the cache is not the problem.

What kind of entry's "get_load_size" callback is being invoked to create the corrupted length?

Thanks, Quincey. H5HL__cache_prefix_get_final_load_size/H5HL__hdr_deserialize:
heap.dblk_size = 18446744073709551392

@qkoziol
Copy link
Collaborator

qkoziol commented Nov 6, 2024

OK, so it's in the local heap decode / get size callback. Is there any sanity checking you can do there?

@bmribler
Copy link
Collaborator Author

bmribler commented Nov 6, 2024

OK, so it's in the local heap decode / get size callback. Is there any sanity checking you can do there?

Oh, I think I can do a similar check in H5HL__cache_prefix_get_final_load_size. Right? Or maybe, H5HL__hdr_deserialize, if I have enough info...

@qkoziol
Copy link
Collaborator

qkoziol commented Nov 6, 2024

Yes, adding a sensible range check there is good.

@bmribler bmribler marked this pull request as draft November 7, 2024 17:22
@bmribler bmribler marked this pull request as ready for review December 3, 2024 19:24
@bmribler bmribler requested a review from qkoziol December 13, 2024 19:36
@lrknox lrknox merged commit 99aac48 into HDFGroup:develop Jan 26, 2025
qkoziol pushed a commit to qkoziol/hdf5 that referenced this pull request Feb 3, 2025
A decoded length appeared to be corrupted and had a very large value.
This PR added a check to detect such potential data corruption.
qkoziol pushed a commit to qkoziol/hdf5 that referenced this pull request Feb 3, 2025
A decoded length appeared to be corrupted and had a very large value.
This PR added a check to detect such potential data corruption.
byrnHDF pushed a commit to byrnHDF/hdf5 that referenced this pull request Feb 10, 2025
A decoded length appeared to be corrupted and had a very large value.
This PR added a check to detect such potential data corruption.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Type - Security Security issues, including library crashers and memory leaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allocation-size-too-big error in H5MM.c
4 participants