summaryrefslogtreecommitdiff
path: root/firmware/lib/include
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-09-28 15:53:21 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-05 21:24:44 -0700
commit95554e4e62dc2ae8333a6487f973f830753de071 (patch)
tree37e80b101da6553108bb641e147b91bcf8e0a489 /firmware/lib/include
parente95ceff307f6c5c457f3e805991804ae2c7cb50c (diff)
downloadvboot-95554e4e62dc2ae8333a6487f973f830753de071.tar.gz
Check EC_IN_RW before proceeding to recovery mode
Depthcharge currently asks EC whether recovery was requested manually or not without verifying EC is in RO or not. If EC-RW is compromised, recovery switch state can be spoofed. This patch makes Depthcharge check EC_IN_RW to determine whether EC is in RO or not. Only if it's in RO and it says recovery button was pressed at boot, we proceed to the recovery process. All other recovery requests including manual recovery requested by a (compromised) host will end up with 'broken' screen. BUG=b:66516882 BRANCH=none TEST=Boot Fizz. make runtests. Change-Id: I01d2df05fe22e79bbc949f5cb83db605147667b3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/693008 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware/lib/include')
-rw-r--r--firmware/lib/include/vboot_common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/lib/include/vboot_common.h b/firmware/lib/include/vboot_common.h
index 88bcb631..acfb58b7 100644
--- a/firmware/lib/include/vboot_common.h
+++ b/firmware/lib/include/vboot_common.h
@@ -137,4 +137,17 @@ uint64_t VbSharedDataReserve(VbSharedDataHeader *header, uint64_t size);
int VbSharedDataSetKernelKey(VbSharedDataHeader *header,
const VbPublicKey *src);
+/**
+ * Check whether recovery is allowed or not.
+ *
+ * The only way to pass this check and proceed to the recovery process is to
+ * physically request a recovery (a.k.a. manual recovery). All other recovery
+ * requests including manual recovery requested by a (compromised) host will
+ * end up with 'broken' screen.
+ *
+ * @param flags Flags of VbSharedDataHeader.
+ * @return 1: Yes. 0: No or not sure.
+ */
+int vb2_allow_recovery(uint32_t flags);
+
#endif /* VBOOT_REFERENCE_VBOOT_COMMON_H_ */