Commit 7e8a05b4 authored by Stefan Haberland's avatar Stefan Haberland Committed by Jens Axboe

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: a91ff09d ("s390/dasd: add copy pair setup")
Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
Link: https://lore.kernel.org/r/20221123160719.3002694-5-sth@linux.ibm.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 590ce6d9
......@@ -1954,7 +1954,7 @@ dasd_copy_pair_show(struct device *dev,
break;
}
}
if (!copy->entry[i].primary)
if (i == DASD_CP_ENTRIES)
goto out;
/* print all secondary */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment