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

vdev_draid_lookup_map() should not iterate outside draid_maps #13865

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Sep 9, 2022

Motivation and Context

Coverity reported this as an out-of-bounds read.

Description

We only have 254 entries. Iterating <= 254 causes us to iterate outside of the array. We should iterate < 254.

How Has This Been Tested?

The buildbot will test it for us.

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:

Coverity reported this as an out-of-bounds read.

Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
@ryao ryao changed the title VDEV_DRAID_MAX_MAPS should be 253 vdev_draid_lookup_map() should not iterate outside draid_maps Sep 9, 2022
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Sep 12, 2022
@behlendorf behlendorf merged commit e5327e7 into openzfs:master Sep 12, 2022
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 15, 2022
Coverity reported this as an out-of-bounds read.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13865
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 16, 2022
Coverity reported this as an out-of-bounds read.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13865
beren12 pushed a commit to beren12/zfs that referenced this pull request Sep 19, 2022
Coverity reported this as an out-of-bounds read.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants