Skip to content

Commit

Permalink
fixup! [LibOS] Single-process-lifetime rollback protection for protec…
Browse files Browse the repository at this point in the history
…ted files (SPLRB)

Signed-off-by: g2flyer <michael.steiner@intel.com>
  • Loading branch information
g2flyer committed Jul 9, 2024
1 parent 7ec30e1 commit 8eeed74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/src/protected_files/protected_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8eeed74

Please sign in to comment.