aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Haberland <[email protected]>2022-11-23 17:07:19 +0100
committerJens Axboe <[email protected]>2022-11-23 10:37:37 -0700
commit7e8a05b47ba7200f333eefd19979eeb4d273ceec (patch)
treeeae1830467bc60a144788147d05ea3965f7a484f
parent590ce6d96d6a224b470a3862c33a483d5022bfdb (diff)
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: a91ff09d39f9 ("s390/dasd: add copy pair setup") Signed-off-by: Stefan Haberland <[email protected]> Reviewed-by: Jan Hoeppner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/s390/block/dasd_devmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index cb83f81da416..df17f0f9cb0f 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -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 */