Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image-rs: enclave-cc updates #312

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion attestation-agent/attester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async-trait.workspace = true
az-snp-vtpm = { git = "https://github.com/kinvolk/azure-cvm-tooling", rev = "2c2e411", default-features = false, features = ["attester"], optional = true }
base64.workspace = true
log.workspace = true
occlum_dcap = { git = "https://github.com/occlum/occlum", tag = "v0.29.6", optional = true }
occlum_dcap = { git = "https://github.com/occlum/occlum", tag = "v0.29.7", optional = true }
serde.workspace = true
serde_json.workspace = true
sev = { git = "https://github.com/virtee/sev", version = "1.2", default-features = false, features = ["snp"], optional = true }
Expand Down
12 changes: 3 additions & 9 deletions image-rs/src/snapshots/occlum/unionfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ fn create_environment(mount_path: &Path) -> Result<()> {

impl Snapshotter for Unionfs {
fn mount(&mut self, layer_path: &[&str], mount_path: &Path) -> Result<MountPoint> {
// From the description of https://github.com/occlum/occlum/blob/master/docs/runtime_mount.md#1-mount-trusted-unionfs-consisting-of-sefss ,
// the source type of runtime mount is "unionfs".
let fs_type = String::from("unionfs");
let fs_type = String::from("sefs");
let source = Path::new(&fs_type);

if !mount_path.exists() {
Expand All @@ -125,18 +123,14 @@ impl Snapshotter for Unionfs {
.ok_or(anyhow!("parent do not exist"))?
.file_name()
.ok_or(anyhow!("Unknown error: file name parse fail"))?;
let sefs_base = Path::new("/images").join(cid).join("sefs");
let unionfs_lowerdir = sefs_base.join("lower");
let unionfs_upperdir = sefs_base.join("upper");

// For mounting trusted UnionFS at runtime of occlum,
// you can refer to https://github.com/occlum/occlum/blob/master/docs/runtime_mount.md#1-mount-trusted-unionfs-consisting-of-sefss.
// "c7-32-b3-ed-44-df-ec-7b-25-2d-9a-32-38-8d-58-61" is a hardcode key used to encrypt or decrypt the FS currently,
// and it will be replaced with dynamic key in the near future.
let options = format!(
"lowerdir={},upperdir={},key={}",
unionfs_lowerdir.display(),
unionfs_upperdir.display(),
"dir={},key={}",
Path::new("/images").join(cid).join("sefs/lower").display(),
"c7-32-b3-ed-44-df-ec-7b-25-2d-9a-32-38-8d-58-61"
);

Expand Down
Loading