Skip to content

Commit 7e8a05b

Browse files
Stefan Haberlandaxboe
authored andcommitted
s390/dasd: fix possible buffer overflow in copy_pair_show
dasd_copy_relation->entry[] array might be accessed out of bounds if the loop does not break. Fixes: a91ff09 ("s390/dasd: add copy pair setup") Signed-off-by: Stefan Haberland <sth@linux.ibm.com> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com> Link: https://lore.kernel.org/r/20221123160719.3002694-5-sth@linux.ibm.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 590ce6d commit 7e8a05b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/block/dasd_devmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ dasd_copy_pair_show(struct device *dev,
19541954
break;
19551955
}
19561956
}
1957-
if (!copy->entry[i].primary)
1957+
if (i == DASD_CP_ENTRIES)
19581958
goto out;
19591959

19601960
/* print all secondary */

0 commit comments

Comments
 (0)