Repository navigation
Conversation
nhorman
marked this pull request as draft
June 22, 2026 17:20
nhorman
force-pushed
the
pr1972
branch
2 times, most recently
from
June 22, 2026 19:51
317aab4 to
feb7d14
Compare
nhorman
marked this pull request as ready for review
June 22, 2026 21:24
nhorman
requested review from
Sashan,
andrewkdinh,
bob-beck,
jogme,
mbroz and
t8m
June 22, 2026 21:24
andrewkdinh
requested changes
Jun 23, 2026
npajkovsky
reviewed
Jun 23, 2026
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
create shim functions to cast our void pointers to the proper type so as to avoid undefined behavior warnings
Note, implementing thunking in the PEM_conversion macros creates thunking functions that are statically defined, and unreachable from public apis. As such, [d2i|i2d]_ECPKParameters_fp, which were formerly macros can't use those thunking functions unless they are promoted to full functions, where the implementation is co-located with the thunking function defintion. Make that change here.
Contributor
Author
|
ok, I've rebased this on top of master, now that #31523 has merged, eliminated redundant commits and fixed up what remains. This PR now eliminates ubsan errors in the following functions: Which were the ones remaining as present in a_d2i_fp.c a_i2d_fp.c and pem_lib.c |
andrewkdinh
requested changes
Jun 26, 2026
npajkovsky
reviewed
Jun 30, 2026
npajkovsky
approved these changes
Jul 2, 2026
mbroz
approved these changes
Jul 2, 2026
Collaborator
|
This pull request is ready to merge |
Contributor
|
With the other PR to turn off errors for these, I suggest that this not be merged. |
Contributor
Author
|
closing this as we've decided to suppress these ubsan errors with a compiler flag |
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.
To mitigate some of the ubsan errors in our build we need to create lots of thunking functions, which preform casts to the needed type in the relevant callbacks.
This PR addresses functions revealing such errors in a_d2i_fp.c a_i2d_fp.c and pem_lib.c.
Note: While some of these fixes cover errors in functions above and beyond these files (as it convenient to handle some cases in the macros that implement the functions), there are other potential errors lurking in these files, that aren't reported because they aren't executed during our unit tests.
I've opted to not fix those in this PR as they would likely benefit from having tests added to trigger said ubsan warnings. As such I think it would be better to keep this PR small, and handle those issues independently.