Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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
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

Always perform bounds-checking in metaslab_free_concrete#17136

Open
asomers wants to merge1 commit intoopenzfs:master
base:master
Choose a base branch
Loading
fromasomers:metaslab_free_concrete

Conversation

asomers
Copy link
Contributor

The vd->vdev_ms access can overflow due to on-disk corruption, not just due to programming bugs. So it makes sense to check its boundaries even in production builds.

Sponsored by:ConnectWise
Signed-off-by:Alan Somersasomers@gmail.com

Motivation and Context

Prevents an out-of-bounds memory access due to on-disk corruption. The out of bounds access usually results in a page fault, but its effects are unpredictable. Better to cleanly panic instead. The original corruption was probably caused by the same underlying cause as#16626, combined with inadequate sanity checking of the block pointers.

Description

Changes in existing ASSERT into a VERIFY

How Has This Been Tested?

Ran the ZFS test suite on FreeBSD

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

The vd->vdev_ms access can overflow due to on-disk corruption, not justdue to programming bugs.  So it makes sense to check its boundaries evenin production builds.Sponsored by:ConnectWiseSigned-off-by:Alan Somers <asomers@gmail.com>
Copy link
Member

@amotinamotin left a comment

Choose a reason for hiding this comment

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

I have no objections, but wonder if this is the earliest place we can catch the corruption.

@amotinamotin added the Status: Code Review NeededReady for review and testing labelMar 12, 2025
@amotin
Copy link
Member

This slightly echoes with#17094.

@asomers
Copy link
ContributorAuthor

I have no objections, but wonder if this is the earliest place we can catch the corruption.

I hope there's a better place to catch it. I plan to keep working on the problem. But in the meantime I think this change is correct. Maybe after#17094 there will be a better way to handle it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alek-palek-palek-p approved these changes

@amotinamotinamotin approved these changes

@tonyhuttertonyhuttertonyhutter approved these changes

Assignees
No one assigned
Labels
Status: Code Review NeededReady for review and testing
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@asomers@amotin@alek-p@tonyhutter

[8]ページ先頭

©2009-2025 Movatter.jp