Skip to content

Conversation

soph-dec
Copy link
Contributor

@soph-dec soph-dec commented Nov 8, 2023

Replace incorrect H5L_info1_t__u with H5L_info2_t__u. Since H5L_info1_t__u does not have the same size as H5L_info2_t__u, this bug resulted in 8 bytes of stack memory outside the allocated region being overwritten by the hdf5 C-library for example when using H5Lget_info2.

Since Debug can no longer be derived, add a manual implementation for the struct H5L_info2_t in order to correctly match the variant of H5L_info2_t__u to the link type.

Additionally, add methods to access the union fields of H5L_info2_t__u.

Replace incorrect `H5L_info1_t__u` with `H5L_info2_t__u`. Since
`H5L_info1_t__u` does not have the same size as `H5L_info2_t__u`, this
bug resulted in 8 bytes of stack memory outside the allocated region
being overwritten by the hdf5 C-library for example when using
`H5Lget_info2`.

Since `Debug` can no longer be derived, add a manual implementation for
the struct `H5L_info2_t` in order to correctly match the variant of
`H5L_info2_t__u` to the link type.

Additionally, add methods to access the union fields of
`H5L_info2_t__u`.
Copy link
Collaborator

@mulimoen mulimoen left a comment

Choose a reason for hiding this comment

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

Great catch in finding this bug

@soph-dec
Copy link
Contributor Author

soph-dec commented Nov 8, 2023

I pushed one more commit to fix the clippy error in hdf5-sys. Some of the other tests are still failing, but I do not know how this could be connected to my changes.

@mulimoen
Copy link
Collaborator

mulimoen commented Nov 8, 2023

The clippy and MSRV jobs are known to be failing. On windows we have started to get some random failures, although unrelated to this change

@soph-dec
Copy link
Contributor Author

soph-dec commented Nov 8, 2023

I see, thanks for clarifying!

@mulimoen mulimoen merged commit 2e44e90 into aldanor:master Nov 8, 2023
@soph-dec soph-dec deleted the fix-definition-of-h5l_info2_t branch November 9, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants