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

Fix invalid drop impl call in Report::downcast #143

Merged
merged 1 commit into from
Dec 30, 2023
Merged

Conversation

ten3roberts
Copy link
Contributor

@ten3roberts ten3roberts commented Dec 29, 2023

The context chain downcast called converted to the wrong inner type which caused the wrong drop impl to be called.

The tests did not catch this because they had compatible drop implementations due to matching type layout. Solved by swizzling the fields of the chain test types to force incompatible layouts

Resolves: #141

The context chain downcast called converted to the wrong inner type
which caused the wrong drop impl to be called.

The tests did not catch this because they had compatible drop
implementations due to matching type layout. Solved by swizzling the
fields of the chain test types to force incompatible layouts
@ten3roberts ten3roberts added C-bug Category: Something isn't working A-eyre Area: eyre subcrate labels Dec 29, 2023
Copy link
Contributor

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

This seems worth publishing an advisory for: https://github.com/rustsec/advisory-db

@thenorili
Copy link
Contributor

Great catch, and clever work on the test!

Copy link
Contributor

@thenorili thenorili left a comment

Choose a reason for hiding this comment

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

Looks good to me, excellent work debugging the test.

@thenorili thenorili merged commit 770ac3f into master Dec 30, 2023
29 checks passed
@thenorili thenorili deleted the fix-invalid-drop branch December 30, 2023 01:32
@stevepryde
Copy link

Any reason why this fix hasn't been released yet (and affected versions yanked)? It's a known soundness issue in a popular crate.

@thenorili
Copy link
Contributor

Thanks for pointing that out. There were some cross wires and folks thought it had made it into the last release when it had not. Working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-eyre Area: eyre subcrate C-bug Category: Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault in Report::downcast() introduced in 0.6.9
4 participants