Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cms: store digest as pointer instead of index #91

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

frozencemetery
Copy link
Member

Storage as an index is problematic because the sentinel value -1 was
used, but accesses were unchecked, leading to crashes like that in
3b1031a ("pesigcheck: Fix crash on
digest match"). By storing a pointer, we get an explicit NULL
dereference: still a crash, but preferred since it's clearer.

Since the index was previously also used for retrieving digest
parameters, include a pointer to the relevant struct digest_param in the
struct digest.

Signed-off-by: Robbie Harwood [email protected]

[This is the refactor suggested in #90.]

Storage as an index is problematic because the sentinel value -1 was
used, but accesses were unchecked, leading to crashes like that in
3b1031a ("pesigcheck: Fix crash on
digest match").  By storing a pointer, we get an explicit NULL
dereference: still a crash, but preferred since it's clearer.

Since the index was previously also used for retrieving digest
parameters, include a pointer to the relevant struct digest_param in the
struct digest.

Signed-off-by: Robbie Harwood <[email protected]>
@frozencemetery frozencemetery requested a review from vathpela June 10, 2022 18:44
@frozencemetery frozencemetery merged commit 926782c into rhboot:main Jun 15, 2022
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.

1 participant