]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm verity: fix biovecs hash calculation regression
authorMilan Broz <gmazyland@gmail.com>
Mon, 14 Apr 2014 20:02:30 +0000 (22:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 17:28:12 +0000 (10:28 -0700)
commitc80498a9f6b91d35bc6b6dfd185886d8d4346d43
tree8c09795b6354696d971086f3050d4febf5e5f60c
parent14f7702f692048e1426d763457a34cb02e5c4267
dm verity: fix biovecs hash calculation regression

commit 3a7745215e7f73a5c7d9bcdc50661a55b39052a3 upstream.

Commit 003b5c5719f159f4f4bf97511c4702a0638313dd ("block: Convert drivers
to immutable biovecs") incorrectly converted biovec iteration in
dm-verity to always calculate the hash from a full biovec, but the
function only needs to calculate the hash from part of the biovec (up to
the calculated "todo" value).

Fix this issue by limiting hash input to only the requested data size.

This problem was identified using the cryptsetup regression test for
veritysetup (verity-compat-test).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-verity.c