Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

uefi: Fix lifetimes in device_path TryFrom<&[u8]> impls#1282

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

nicholasbishop
Copy link
Member

The missing lifetime means that the &[u8] buffer could be freed while the &DevicePath still exists, which is UB.

Bug:#1281

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

The missing lifetime means that the &[u8] buffer could be freed while the&DevicePath still exists, which is UB.
@phip1611
Copy link
Member

Shouldn't miri catch this? Ah, I guess there are no unit tests for this functionality?

@nicholasbishop
Copy link
MemberAuthor

nicholasbishop commentedAug 1, 2024
edited
Loading

There are some tests. But since miri is a runtime checker, not a static analyzer, it would only catch it if you modified the test to drop the source buffer early. (And we don't want to modify the tests to do that, because then the code wouldn't compile with the fix.)

@phip1611phip1611 added this pull request to themerge queueAug 2, 2024
Merged via the queue intorust-osdev:main with commita457110Aug 2, 2024
13 checks passed
@nicholasbishopnicholasbishop deleted the bishop-fix-dp-lifetimes branchAugust 2, 2024 15:15
nicholasbishop added a commit to nicholasbishop/uefi-rs that referenced this pull requestAug 2, 2024
This release contains a cherry-pick ofrust-osdev#1282.
@nicholasbishopnicholasbishop mentioned this pull requestAug 2, 2024
2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@phip1611phip1611Awaiting requested review from phip1611

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@nicholasbishop@phip1611

[8]ページ先頭

©2009-2025 Movatter.jp