Skip to content
Commit 781248c1 authored by Nikanth Karthikesan's avatar Nikanth Karthikesan Committed by Alasdair G Kergon
Browse files

dm stripe: avoid divide by zero with invalid stripe count



If a table containing zero as stripe count is passed into stripe_ctr
the code attempts to divide by zero.

This patch changes DM_TABLE_LOAD to return -EINVAL if the stripe count
is zero.

We now get the following error messages:
  device-mapper: table: 253:0: striped: Invalid stripe count
  device-mapper: ioctl: error adding target to table

Signed-off-by: default avatarNikanth Karthikesan <knikanth@suse.de>
Cc: stable@kernel.org
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 0813e22d
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