Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17f248d2 authored by Prashant Malani's avatar Prashant Malani Committed by bowgotsai
Browse files

fs_mgr: Fix disable-verity for verifyatboot partitions

This allows a remount to be performed on partitions which have been
verified at boot, without causing the verity service to complain of
"corrupted" blocks that could have been modified as a result of a
remount (while the verity checksum remained unchanged).

(cherry picked from commit dd78ae75)

Bug: 32638755
Test: Compile
Change-Id: I77cf7dd20ee5c5f5dac80f73f292e32583fe5906
parent 2cdc67ee
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -825,7 +825,7 @@ int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback)
    char fstab_filename[PROPERTY_VALUE_MAX + sizeof(FSTAB_PREFIX)];
    const char *mount_point;
    char propbuf[PROPERTY_VALUE_MAX];
    char *status;
    const char *status;
    int fd = -1;
    int i;
    int mode;
@@ -875,10 +875,14 @@ int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback)
        verity_ioctl_init(io, mount_point, 0);

        if (ioctl(fd, DM_TABLE_STATUS, io)) {
            if (fstab->recs[i].fs_mgr_flags & MF_VERIFYATBOOT) {
                status = "V";
            } else {
                ERROR("Failed to query DM_TABLE_STATUS for %s (%s)\n", mount_point,
                      strerror(errno));
                continue;
            }
        }

        status = &buffer[io->data_start + sizeof(struct dm_target_spec)];