]> nv-tegra.nvidia Code Review - linux-4.9.git/commit
ANDROID: AVB error handler to invalidate vbmeta partition.
authorDavid Zeuthen <zeuthen@google.com>
Tue, 24 Jan 2017 18:17:01 +0000 (13:17 -0500)
committermobile promotions <svcmobile_promotions@nvidia.com>
Sat, 20 Oct 2018 06:34:07 +0000 (23:34 -0700)
commit50a6b1eb33fee604e45dfab55ea82d4d618f8dd3
tree29152816c4e9cee947646d5c2d875c84e52ada81
parentcc75beeeaaefb23d02a2b8165b5a0809b9735b76
ANDROID: AVB error handler to invalidate vbmeta partition.

If androidboot.vbmeta.invalidate_on_error is 'yes' and
androidboot.vbmeta.device is set and points to a device with vbmeta
magic, this header will be overwritten upon an irrecoverable dm-verity
error. The side-effect of this is that the slot will fail to verify on
next reboot, effectively triggering the boot loader to fallback to
another slot. This work both if the vbmeta struct is at the start of a
partition or if there's an AVB footer at the end.

This code is based on drivers/md/dm-verity-chromeos.c from ChromiumOS.

Signed-off-by: David Zeuthen <zeuthen@google.com>
(cherry picked from commit 9dc978d43ec78fb3d5126c1155369bd70d29fc96)

Bug 200437731

Change-Id: I2a8b155007a82ef70891584d031494895c7fa112
Reviewed-on: https://git-master.nvidia.com/r/1925339
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gerber Huang <gerberh@nvidia.com>
Tested-by: Gerber Huang <gerberh@nvidia.com>
Reviewed-by: Yijun Zhou <yijunz@nvidia.com>
Reviewed-by: Ian Chang <ianc@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/md/Kconfig
drivers/md/Makefile
drivers/md/dm-verity-avb.c [new file with mode: 0644]
drivers/md/dm-verity-target.c
drivers/md/dm-verity.h