[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200504165444.248614958@linuxfoundation.org>
Date: Mon, 4 May 2020 19:57:20 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Sunwook Eom <speed.eom@...sung.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Mike Snitzer <snitzer@...hat.com>
Subject: [PATCH 4.9 10/18] dm verity fec: fix hash block number in verity_fec_decode
From: Sunwook Eom <speed.eom@...sung.com>
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@...r.kernel.org
Signed-off-by: Sunwook Eom <speed.eom@...sung.com>
Reviewed-by: Sami Tolvanen <samitolvanen@...gle.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/md/dm-verity-fec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 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 *
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
Powered by blists - more mailing lists