summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-07-13 14:56:12 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-07-17 21:52:49 -0700
commit220d6884b3a00bb3067a4fdcbaf5b6e2b4f891fe (patch)
treeeed7ab9074ac726eb75ae7d9db53c6b5f598c834
parent3fd4c5d13890da44caa59abc85e05c980bcc3ec1 (diff)
downloadchrome-ec-220d6884b3a00bb3067a4fdcbaf5b6e2b4f891fe.tar.gz
rwsig: If RW cannot be locked separately, always increment rollback
BRANCH=none BUG=b:111190988 TEST=Lock RO, flash RW images of increasing CONFIG_ROLLBACK_VERSION, see that rollback minimum version is incremented in rollbackinfo. Change-Id: I48ee68d37098b74478432db9bf84dc96d1ef2dd8 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1137981 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/rwsig.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/rwsig.c b/common/rwsig.c
index 7164e2e208..6c3def7afc 100644
--- a/common/rwsig.c
+++ b/common/rwsig.c
@@ -199,11 +199,14 @@ int rwsig_check_signature(void)
* if rollback information should be updated.
*
* When system is locked, we only increment the rollback if RW is
- * currently protected.
+ * currently protected (and if CONFIG_FLASH_PROTECT_RW is defined).
*/
- if (rw_rollback_version != min_rollback_version &&
- ((!system_is_locked() ||
- flash_get_protect() & EC_FLASH_PROTECT_RW_NOW))) {
+ if (rw_rollback_version != min_rollback_version
+#ifdef CONFIG_FLASH_PROTECT_RW
+ && ((!system_is_locked() ||
+ flash_get_protect() & EC_FLASH_PROTECT_RW_NOW))
+#endif
+ ) {
/*
* This will fail if the rollback block is protected (RW image
* will unprotect that block later on).