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

vmbus_async: don't panic on empty external data #621

Merged
merged 11 commits into from
Jan 9, 2025

Conversation

mattkur
Copy link
Contributor

@mattkur mattkur commented Jan 7, 2025

Don't panic when a GpaDirect packet contains a pointer to empty GPA ranges. This data is guest controlled and not a programmer error, so panic is not correct. Consumers of read_external_ranges already handle errors gracefully, so this is not a significant change for them.

As a drive-by code improvement, also change some cases of #[from] to #[source] in error definitions, and add the requisite .map_err changes.

@mattkur mattkur requested review from a team as code owners January 7, 2025 18:28
@mattkur mattkur mentioned this pull request Jan 8, 2025
@jstarks jstarks changed the title vmbus: don't panic on empty external data vmbus_async: don't panic on empty external data Jan 8, 2025
@mattkur mattkur requested a review from a team as a code owner January 8, 2025 22:01
Copy link
Member

@jstarks jstarks left a comment

Choose a reason for hiding this comment

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

Thanks, Matt.

@mattkur mattkur merged commit e5c5db1 into microsoft:main Jan 9, 2025
25 checks passed
@benhillis benhillis added the backport_2411 Change should be backported to the release/2411 branch label Feb 6, 2025
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Feb 6, 2025
Don't `panic` when a GpaDirect packet contains a pointer to empty GPA
ranges. This data is guest controlled and not a programmer error, so
`panic` is not correct. Consumers of `read_external_ranges` already
handle errors gracefully, so this is not a significant change for them.

As a drive-by code improvement, also change some cases of `#[from]` to
`#[source]` in error definitions, and add the requisite `.map_err`
changes.
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Feb 7, 2025
Don't `panic` when a GpaDirect packet contains a pointer to empty GPA
ranges. This data is guest controlled and not a programmer error, so
`panic` is not correct. Consumers of `read_external_ranges` already
handle errors gracefully, so this is not a significant change for them.

As a drive-by code improvement, also change some cases of `#[from]` to
`#[source]` in error definitions, and add the requisite `.map_err`
changes.
benhillis added a commit that referenced this pull request Feb 7, 2025
Don't `panic` when a GpaDirect packet contains a pointer to empty GPA
ranges. This data is guest controlled and not a programmer error, so
`panic` is not correct. Consumers of `read_external_ranges` already
handle errors gracefully, so this is not a significant change for them.

As a drive-by code improvement, also change some cases of `#[from]` to
`#[source]` in error definitions, and add the requisite `.map_err`
changes.

Co-authored-by: Matt Kurjanowicz <[email protected]>
@mattkur mattkur deleted the empty-external-data branch February 7, 2025 22:52
@jstarks
Copy link
Member

jstarks commented Feb 8, 2025

Backported in #802

@jstarks jstarks added backported_2411 PR that has been backported to release/2411 and removed backport_2411 Change should be backported to the release/2411 branch labels Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport_2411_approved backported_2411 PR that has been backported to release/2411
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants