]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm verity fec: limit error correction recursion
authorSami Tolvanen <samitolvanen@google.com>
Wed, 15 Mar 2017 22:12:23 +0000 (15:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:42:05 +0000 (12:42 +0200)
commit88c358b1f453e34a635fc9bc5fb3a9a6e485c508
tree3f18965f63bea9fd340832f8ed51088a5cddd2f6
parent523a193242674a267d09c6c457b316d82dbeed57
dm verity fec: limit error correction recursion

commit f1a880a93baaadb14c10a348fd199f1cdb6bcccd upstream.

If the hash tree itself is sufficiently corrupt in addition to data blocks,
it's possible for error correction to end up in a deep recursive loop,
which eventually causes a kernel panic.  This change limits the
recursion to a reasonable level during a single I/O operation.

Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-verity-fec.c
drivers/md/dm-verity-fec.h