summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-06-15 22:27:08 +0200
committerMike Snitzer <snitzer@redhat.com>2016-07-18 15:37:19 -0400
commit75dd3b9ecb027e90261ed4052e155e0c1236d717 (patch)
treea62e1f12e02dcb80cfd0b6fd69dfd1556350de11 /drivers/md
parent5fa146b25ba86682f74e3060debd4c4d3073561b (diff)
downloadlinux-75dd3b9ecb027e90261ed4052e155e0c1236d717.tar.bz2
dm raid: more restricting data_offset value checks
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-raid.c3
1 files changed, 2 insertions, 1 deletions
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;
}