From 8eeed74f80f86c0e8ba5b7d9c9ad16dd745e5b4e Mon Sep 17 00:00:00 2001 From: g2flyer Date: Tue, 9 Jul 2024 10:14:23 -0700 Subject: [PATCH] fixup! [LibOS] Single-process-lifetime rollback protection for protected files (SPLRB) Signed-off-by: g2flyer --- common/src/protected_files/protected_files.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/protected_files/protected_files.c b/common/src/protected_files/protected_files.c index 8288406458..5f9d9c12dd 100644 --- a/common/src/protected_files/protected_files.c +++ b/common/src/protected_files/protected_files.c @@ -1090,7 +1090,7 @@ static bool ipf_close(pf_context_t* pf, pf_mac_t* closing_root_gmac) { } if (closing_root_gmac != NULL) { - memcpy(*closing_root_gmac, pf->file_metadata.plain_part.metadata_gmac, sizeof(pf_mac_t)); + memcpy(*closing_root_gmac, pf->metadata_node.plaintext_part.metadata_mac, sizeof(pf_mac_t)); } // omeg: fs close is done by Gramine handler @@ -1138,7 +1138,7 @@ pf_status_t pf_open(pf_handle_t handle, const char* path, uint64_t underlying_si pf_status_t status; *context = ipf_open(path, mode, create, handle, underlying_size, key, &status); if ((*context != NULL) && (opening_root_gmac != NULL)) { - memcpy(*opening_root_gmac, (*context)->file_metadata.plain_part.metadata_gmac, + memcpy(*opening_root_gmac, (*context)->metadata_node.plaintext_part.metadata_mac, sizeof(pf_mac_t)); } return status; @@ -1234,7 +1234,7 @@ pf_status_t pf_rename(pf_context_t* pf, const char* new_path, pf_mac_t* new_root if (!ipf_internal_flush(pf)) return pf->last_error; if (new_root_gmac != NULL) { - memcpy(*new_root_gmac, pf->file_metadata.plain_part.metadata_gmac, sizeof(pf_mac_t)); + memcpy(*new_root_gmac, pf->metadata_node.plaintext_part.metadata_mac, sizeof(pf_mac_t)); } return PF_STATUS_SUCCESS;