diff options
Diffstat (limited to 'firmware/2lib/2ec_sync.c')
-rw-r--r-- | firmware/2lib/2ec_sync.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/2lib/2ec_sync.c b/firmware/2lib/2ec_sync.c index e82366d9..e4642164 100644 --- a/firmware/2lib/2ec_sync.c +++ b/firmware/2lib/2ec_sync.c @@ -135,6 +135,7 @@ static vb2_error_t check_ec_hash(struct vb2_context *ctx, if (vb2_safe_memcmp(hmir, hexp, hexp_len)) { VB2_DEBUG("Hmir != Hexp. Update Hmir.\n"); vb2_secdata_kernel_set_ec_hash(ctx, hexp); + sd->flags |= VB2_SD_FLAG_ECSYNC_HMIR_UPDATED; } } @@ -277,6 +278,15 @@ static vb2_error_t sync_ec(struct vb2_context *ctx) } } + if (sd->flags & VB2_SD_FLAG_ECSYNC_HMIR_UPDATED) { + /* + * After Hmir is updated, EFS needs to be retried since the + * verification result is revoked. + */ + VB2_DEBUG("Reset EC after Hmir update\n"); + return VBERROR_EC_REBOOT_TO_RO_REQUIRED; + } + /* Tell EC to jump to RW. It should already be in RW for EFS2. */ if (!(sd->flags & VB2_SD_FLAG_ECSYNC_EC_IN_RW)) { VB2_DEBUG("jumping to EC-RW\n"); |