mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 15:12:59 +02:00
dm integrity: fix a crash if "recalculate" used without "internal_hash"
commit 2d06dfecb1 upstream.
Recalculate can only be specified with internal_hash.
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
97c5846e04
commit
cf750e09d1
|
|
@ -3515,6 +3515,12 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
|
|||
r = -ENOMEM;
|
||||
goto bad;
|
||||
}
|
||||
} else {
|
||||
if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING)) {
|
||||
ti->error = "Recalculate can only be specified with internal_hash";
|
||||
r = -EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
|
||||
ic->bufio = dm_bufio_client_create(ic->meta_dev ? ic->meta_dev->bdev : ic->dev->bdev,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user