]> git.baikalelectronics.ru Git - kernel.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)
committerMike Snitzer <snitzer@redhat.com>
Tue, 15 Apr 2014 16:19:24 +0000 (12:19 -0400)
commitd5e7f81ece75bf62a391300b6450fc181e8c7a63
treefd2f52eb17ae4aca928511c2e713ef425cb3be95
parent666fc5db2b1a8123c1c97deb08e671a5b705fc29
dm verity: fix biovecs hash calculation regression

Commit be30a4440ec316315c28c392f657e9bf936fc313 ("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>
Cc: stable@vger.kernel.org # 3.14+
drivers/md/dm-verity.c