summaryrefslogtreecommitdiff
path: root/libfec
diff options
context:
space:
mode:
authorSandeep Patil <sspatil@google.com>2018-07-31 13:54:28 -0700
committerSandeep Patil <sspatil@google.com>2018-07-31 13:54:28 -0700
commite5417b96b2a5cec073e7df8c02a68d1539735f68 (patch)
treee8836bb4a0113bd17745b9fda8911a25a91cb0e6 /libfec
parentfde6f72cf0273cc419eeae841ec51988b7aa9650 (diff)
downloadextras-e5417b96b2a5cec073e7df8c02a68d1539735f68.tar.gz
libfec: skip over verity tree when reading metadata from filesystem.
If partition size > filesystem image, we must skip over the verity tree appended to the filesystem image when trying to find the verity metadata. Bug: 112046449 Test: Enable verity for hikey960 (system partition size = ~2 x filesystem size) and boot. Change-Id: Ia6cdbc0f35a98fdfa1fb4677951ae5c829cabb0f Signed-off-by: Sandeep Patil <sspatil@google.com>
Diffstat (limited to 'libfec')
-rw-r--r--libfec/fec_open.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libfec/fec_open.cpp b/libfec/fec_open.cpp
index 7b4a5a07..060f549b 100644
--- a/libfec/fec_open.cpp
+++ b/libfec/fec_open.cpp
@@ -328,9 +328,10 @@ static int load_verity(fec_handle *f)
/* legacy format after the file system, but not at the end */
int rc = get_fs_size(f, &offset);
-
if (rc == 0) {
debug("file system size = %" PRIu64, offset);
+ /* Jump over the verity tree appended to the filesystem */
+ offset += verity_get_size(offset, NULL, NULL);
rc = verity_parse_header(f, offset);
if (rc == 0) {