提交 8cfa8f49 编写于 作者: S Sunwook Eom 提交者: Yang Yingliang

dm verity fec: fix hash block number in verity_fec_decode

stable inclusion
from linux-4.19.121
commit d4440a77802d2b3c494eb9711bf26e98331ab702

--------------------------------

commit ad4e80a6 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: a739ff3f ("dm verity: add support for forward error correction")
Cc: stable@vger.kernel.org
Signed-off-by: NSunwook Eom <speed.eom@samsung.com>
Reviewed-by: NSami Tolvanen <samitolvanen@google.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7201ffc0
...@@ -436,7 +436,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io, ...@@ -436,7 +436,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io,
fio->level++; fio->level++;
if (type == DM_VERITY_BLOCK_TYPE_METADATA) 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 * For RS(M, N), the continuous FEC data is divided into blocks of N
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册