From: Heinz Mauelshagen Date: Wed, 15 Jun 2016 20:27:08 +0000 (+0200) Subject: dm raid: more restricting data_offset value checks X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=75dd3b9ecb027e90261ed4052e155e0c1236d717;p=linux-beck.git dm raid: more restricting data_offset value checks Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index a38298589db8..b1dbf28f36d2 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -1221,7 +1221,8 @@ static int parse_raid_params(struct raid_set *rs, struct dm_arg_set *as, return -EINVAL; } /* Ensure sensible data offset */ - if (value < 0) { + if (value < 0 || + (value && (value < MIN_FREE_RESHAPE_SPACE || value % to_sector(PAGE_SIZE)))) { rs->ti->error = "Bogus data_offset value"; return -EINVAL; }