dm-verity.c: restore transient error handling

The upstream version of dm-verity.c allows all error handling to pass up
the block layer with the bio.  The re-insertion of dm-verity-chromeos.c
meant that we want to catch errors when v->hash_failed==1 and
appropriately nuke the associated kernel.

At present, every block layer error will be translated into a
hash_failed because the bad bio will traverse a verification of its data
(which is likely non-existent).  During verity_finish_io() the device
will fail.  This change restores transient versus non-transient error
handling by catching bio errors prior to the verify call and passing
them directly to the finish handler without hash_failed being set.

Signed-off-by: Will Drewry <wad@chromium.org>

BUG=chromium:328926
TEST=it compiles. See the bug for the testing script and procedures used!

Change-Id: Ib9a49517005e48b3626289ccafdb8002c16167a2
Reviewed-on: https://chromium-review.googlesource.com/180294
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180923
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180825
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
1 file changed