]> 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)
commit4fa7af957bba73c1dcb2ba1b742f7130ab77f409
treefd2f52eb17ae4aca928511c2e713ef425cb3be95
parent4407ddf25c4beb7d64240be48c4da25c148d3847
dm verity: fix biovecs hash calculation regression

Commit 6b2c5bb6c5d0670ad3853d936935152e310fca27 ("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