diff options
author | Sunwook Eom <speed.eom@samsung.com> | 2020-04-10 12:54:19 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-05 19:14:38 +0200 |
commit | 779bb3625fed4a065a8b2a65323e287a475afba1 (patch) | |
tree | 42563f6ce3f85aebb0d84d04f7ca93665a219805 /drivers/md/dm-verity-fec.c | |
parent | 9199193d8dc094127b36ce679bfef463fc2e81ba (diff) | |
download | linux-stable-779bb3625fed4a065a8b2a65323e287a475afba1.tar.gz linux-stable-779bb3625fed4a065a8b2a65323e287a475afba1.tar.bz2 linux-stable-779bb3625fed4a065a8b2a65323e287a475afba1.zip |
dm verity fec: fix hash block number in verity_fec_decode
commit ad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc upstream.
The error correction data is computed as if data and hash blocks
were concatenated. But hash block number starts from v->hash_start.
So, we have to calculate hash block number based on that.
Fixes: a739ff3f543af ("dm verity: add support for forward error correction")
Cc: stable@vger.kernel.org
Signed-off-by: Sunwook Eom <speed.eom@samsung.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/dm-verity-fec.c')
-rw-r--r-- | drivers/md/dm-verity-fec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 8f9957d31a3e..1640298d90fd 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -447,7 +447,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io, fio->level++; if (type == DM_VERITY_BLOCK_TYPE_METADATA) - block += v->data_blocks; + block = block - v->hash_start + v->data_blocks; /* * For RS(M, N), the continuous FEC data is divided into blocks of N |