aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2022-09-12 15:51:17 -0400
committerTony Hutter <[email protected]>2022-09-15 16:58:35 -0700
commit3f7c174b50a3430adf68ae2f91146cc4206c5e0c (patch)
tree431fd74e13a1526bf9a47712da3759cd7e97d57a /module
parent03fa3ef264ab80296bad9b4ad54af8714a03df95 (diff)
vdev_draid_lookup_map() should not iterate outside draid_maps
Coverity reported this as an out-of-bounds read. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #13865
Diffstat (limited to 'module')
-rw-r--r--module/zfs/vdev_draid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/vdev_draid.c b/module/zfs/vdev_draid.c
index db87e69f2..7e654ca24 100644
--- a/module/zfs/vdev_draid.c
+++ b/module/zfs/vdev_draid.c
@@ -541,7 +541,7 @@ vdev_draid_generate_perms(const draid_map_t *map, uint8_t **permsp)
int
vdev_draid_lookup_map(uint64_t children, const draid_map_t **mapp)
{
- for (int i = 0; i <= VDEV_DRAID_MAX_MAPS; i++) {
+ for (int i = 0; i < VDEV_DRAID_MAX_MAPS; i++) {
if (draid_maps[i].dm_children == children) {
*mapp = &draid_maps[i];
return (0);