Skip to content

Commit 8eeed74

Browse files
committed
fixup! [LibOS] Single-process-lifetime rollback protection for protected files (SPLRB)
Signed-off-by: g2flyer <[email protected]>
1 parent 7ec30e1 commit 8eeed74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/src/protected_files/protected_files.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ static bool ipf_close(pf_context_t* pf, pf_mac_t* closing_root_gmac) {
10901090
}
10911091

10921092
if (closing_root_gmac != NULL) {
1093-
memcpy(*closing_root_gmac, pf->file_metadata.plain_part.metadata_gmac, sizeof(pf_mac_t));
1093+
memcpy(*closing_root_gmac, pf->metadata_node.plaintext_part.metadata_mac, sizeof(pf_mac_t));
10941094
}
10951095

10961096
// 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
11381138
pf_status_t status;
11391139
*context = ipf_open(path, mode, create, handle, underlying_size, key, &status);
11401140
if ((*context != NULL) && (opening_root_gmac != NULL)) {
1141-
memcpy(*opening_root_gmac, (*context)->file_metadata.plain_part.metadata_gmac,
1141+
memcpy(*opening_root_gmac, (*context)->metadata_node.plaintext_part.metadata_mac,
11421142
sizeof(pf_mac_t));
11431143
}
11441144
return status;
@@ -1234,7 +1234,7 @@ pf_status_t pf_rename(pf_context_t* pf, const char* new_path, pf_mac_t* new_root
12341234
if (!ipf_internal_flush(pf))
12351235
return pf->last_error;
12361236
if (new_root_gmac != NULL) {
1237-
memcpy(*new_root_gmac, pf->file_metadata.plain_part.metadata_gmac, sizeof(pf_mac_t));
1237+
memcpy(*new_root_gmac, pf->metadata_node.plaintext_part.metadata_mac, sizeof(pf_mac_t));
12381238
}
12391239

12401240
return PF_STATUS_SUCCESS;

0 commit comments

Comments
 (0)