diff --git a/demos/remote_attestation/init_ra_flow/init_ra/Cargo.toml b/demos/remote_attestation/init_ra_flow/init_ra/Cargo.toml index fae53884..8cc375ec 100644 --- a/demos/remote_attestation/init_ra_flow/init_ra/Cargo.toml +++ b/demos/remote_attestation/init_ra_flow/init_ra/Cargo.toml @@ -3,7 +3,7 @@ name = "init" version = "0.0.1" build = "build.rs" authors = ["LI Qing geding.lq@antgroup.com"] -edition = "2018" +edition = "2021" [dependencies] libc = "0.2.84" diff --git a/deps/rust-sgx-sdk b/deps/rust-sgx-sdk index 653ffa62..13fb3476 160000 --- a/deps/rust-sgx-sdk +++ b/deps/rust-sgx-sdk @@ -1 +1 @@ -Subproject commit 653ffa62d35fa2996e4a45e9ff89a1391cbd0133 +Subproject commit 13fb3476f53d21614bb863dc7de825e70938ce36 diff --git a/example/init_ra/Cargo.toml b/example/init_ra/Cargo.toml index fae53884..8cc375ec 100644 --- a/example/init_ra/Cargo.toml +++ b/example/init_ra/Cargo.toml @@ -3,7 +3,7 @@ name = "init" version = "0.0.1" build = "build.rs" authors = ["LI Qing geding.lq@antgroup.com"] -edition = "2018" +edition = "2021" [dependencies] libc = "0.2.84" diff --git a/src/exec/Cargo.toml b/src/exec/Cargo.toml index f14e8a76..46c584d2 100644 --- a/src/exec/Cargo.toml +++ b/src/exec/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "occlum_exec" -version = "0.28.1" -edition = "2018" +version = "0.29.0" +edition = "2021" [lib] doctest = false diff --git a/src/exec/rust-toolchain b/src/exec/rust-toolchain index 7cc42efd..480e8aa7 100644 --- a/src/exec/rust-toolchain +++ b/src/exec/rust-toolchain @@ -1 +1 @@ -nightly-2021-11-01 +nightly-2022-02-23 diff --git a/src/libos/Cargo.lock b/src/libos/Cargo.lock index c5242028..3c5f4391 100644 --- a/src/libos/Cargo.lock +++ b/src/libos/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "hashbrown_tstd" -version = "0.11.2" +version = "0.12.0" [[package]] name = "ident_case" @@ -591,11 +591,11 @@ dependencies = [ [[package]] name = "sgx_alloc" -version = "1.1.4" +version = "1.1.5" [[package]] name = "sgx_backtrace_sys" -version = "1.1.4" +version = "1.1.5" dependencies = [ "cc", "sgx_build_helper", @@ -604,11 +604,11 @@ dependencies = [ [[package]] name = "sgx_build_helper" -version = "1.1.4" +version = "1.1.5" [[package]] name = "sgx_cov" -version = "1.1.4" +version = "1.1.5" dependencies = [ "lazy_static", "profiler_builtins", @@ -620,18 +620,18 @@ dependencies = [ [[package]] name = "sgx_demangle" -version = "1.1.4" +version = "1.1.5" [[package]] name = "sgx_libc" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_types", ] [[package]] name = "sgx_rand" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_trts", "sgx_tstd", @@ -640,14 +640,14 @@ dependencies = [ [[package]] name = "sgx_tcrypto" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_types", ] [[package]] name = "sgx_tprotected_fs" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_trts", "sgx_types", @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "sgx_trts" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_libc", "sgx_types", @@ -663,14 +663,14 @@ dependencies = [ [[package]] name = "sgx_tse" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_types", ] [[package]] name = "sgx_tstd" -version = "1.1.4" +version = "1.1.5" dependencies = [ "hashbrown_tstd", "sgx_alloc", @@ -685,11 +685,11 @@ dependencies = [ [[package]] name = "sgx_types" -version = "1.1.4" +version = "1.1.5" [[package]] name = "sgx_unwind" -version = "1.1.4" +version = "1.1.5" dependencies = [ "sgx_build_helper", ] diff --git a/src/libos/Cargo.toml b/src/libos/Cargo.toml index db279445..4b465723 100644 --- a/src/libos/Cargo.toml +++ b/src/libos/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "Occlum" -version = "0.28.1" -edition = "2018" +version = "0.29.0" +edition = "2021" [lib] name = "occlum_libos_core_rs" diff --git a/src/libos/rust-toolchain b/src/libos/rust-toolchain index 7cc42efd..480e8aa7 100644 --- a/src/libos/rust-toolchain +++ b/src/libos/rust-toolchain @@ -1 +1 @@ -nightly-2021-11-01 +nightly-2022-02-23 diff --git a/src/libos/src/entry.rs b/src/libos/src/entry.rs index 2e4dfbd9..d292333f 100644 --- a/src/libos/src/entry.rs +++ b/src/libos/src/entry.rs @@ -107,40 +107,40 @@ pub extern "C" fn occlum_ecall_init( // Parse host file let resolv_conf_ptr = unsafe { (*file_buffer).resolv_conf_buf }; - match parse_host_file(HostFile::RESOLV_CONF, resolv_conf_ptr) { + match parse_host_file(HostFile::ResolvConf, resolv_conf_ptr) { Err(e) => { error!("failed to parse /etc/resolv.conf: {}", e.backtrace()); } Ok(resolv_conf_str) => { *RESOLV_CONF_STR.write().unwrap() = Some(resolv_conf_str); - if let Err(e) = write_host_file(HostFile::RESOLV_CONF) { + if let Err(e) = write_host_file(HostFile::ResolvConf) { error!("failed to write /etc/resolv.conf: {}", e.backtrace()); } } } let hostname_ptr = unsafe { (*file_buffer).hostname_buf }; - match parse_host_file(HostFile::HOSTNAME, hostname_ptr) { + match parse_host_file(HostFile::HostName, hostname_ptr) { Err(e) => { error!("failed to parse /etc/hostname: {}", e.backtrace()); } Ok(hostname_str) => { misc::init_nodename(&hostname_str); *HOSTNAME_STR.write().unwrap() = Some(hostname_str); - if let Err(e) = write_host_file(HostFile::HOSTNAME) { + if let Err(e) = write_host_file(HostFile::HostName) { error!("failed to write /etc/hostname: {}", e.backtrace()); } } } let hosts_ptr = unsafe { (*file_buffer).hosts_buf }; - match parse_host_file(HostFile::HOSTS, hosts_ptr) { + match parse_host_file(HostFile::Hosts, hosts_ptr) { Err(e) => { error!("failed to parse /etc/hosts: {}", e.backtrace()); } Ok(hosts_str) => { *HOSTS_STR.write().unwrap() = Some(hosts_str); - if let Err(e) = write_host_file(HostFile::HOSTS) { + if let Err(e) = write_host_file(HostFile::Hosts) { error!("failed to write /etc/hosts: {}", e.backtrace()); } } diff --git a/src/libos/src/fs/fs_ops/mount.rs b/src/libos/src/fs/fs_ops/mount.rs index d1ffc9d5..4979b9fc 100644 --- a/src/libos/src/fs/fs_ops/mount.rs +++ b/src/libos/src/fs/fs_ops/mount.rs @@ -31,15 +31,15 @@ pub fn do_mount_rootfs( }); // Write resolv.conf file into mounted file system - write_host_file(HostFile::RESOLV_CONF)?; + write_host_file(HostFile::ResolvConf)?; *RESOLV_CONF_STR.write().unwrap() = None; // Write hostname file into mounted file system - write_host_file(HostFile::HOSTNAME)?; + write_host_file(HostFile::HostName)?; *HOSTNAME_STR.write().unwrap() = None; // Write hosts file into mounted file system - write_host_file(HostFile::HOSTS)?; + write_host_file(HostFile::Hosts)?; *HOSTS_STR.write().unwrap() = None; Ok(()) diff --git a/src/libos/src/fs/hostfs.rs b/src/libos/src/fs/hostfs.rs index b18ca96d..4227b3ea 100644 --- a/src/libos/src/fs/hostfs.rs +++ b/src/libos/src/fs/hostfs.rs @@ -355,7 +355,7 @@ trait IntoFsMetadata { impl IntoFsMetadata for fs::Metadata { fn into_fs_metadata(self) -> Metadata { use sgx_trts::libc; - use std::os::fs::MetadataExt; + use std::os::linux::fs::MetadataExt; Metadata { dev: self.st_dev() as usize, inode: self.st_ino() as usize, diff --git a/src/libos/src/lib.rs b/src/libos/src/lib.rs index de4b0c16..06b994ae 100644 --- a/src/libos/src/lib.rs +++ b/src/libos/src/lib.rs @@ -16,7 +16,6 @@ #![feature(dropck_eyepatch)] // for UntrustedSliceAlloc in slice_alloc #![feature(slice_ptr_get)] -#![feature(maybe_uninit_extra)] #![feature(get_mut_unchecked)] // for std::hint::black_box #![feature(test)] diff --git a/src/libos/src/util/host_file_util.rs b/src/libos/src/util/host_file_util.rs index 80f2040a..fef7e836 100644 --- a/src/libos/src/util/host_file_util.rs +++ b/src/libos/src/util/host_file_util.rs @@ -15,16 +15,16 @@ pub struct host_file_buffer { } pub enum HostFile { - HOSTS, - HOSTNAME, - RESOLV_CONF, + Hosts, + HostName, + ResolvConf, } pub fn write_host_file(host_file: HostFile) -> Result<()> { let file_path: &str = match host_file { - HostFile::HOSTS => "/etc/hosts", - HostFile::HOSTNAME => "/etc/hostname", - HostFile::RESOLV_CONF => "/etc/resolv.conf", + HostFile::Hosts => "/etc/hosts", + HostFile::HostName => "/etc/hostname", + HostFile::ResolvConf => "/etc/resolv.conf", _ => return_errno!(EINVAL, "Unsupported host file"), }; @@ -37,9 +37,9 @@ pub fn write_host_file(host_file: HostFile) -> Result<()> { )?; let host_file_str = match host_file { - HostFile::HOSTS => HOSTS_STR.read().unwrap(), - HostFile::HOSTNAME => HOSTNAME_STR.read().unwrap(), - HostFile::RESOLV_CONF => RESOLV_CONF_STR.read().unwrap(), + HostFile::Hosts => HOSTS_STR.read().unwrap(), + HostFile::HostName => HOSTNAME_STR.read().unwrap(), + HostFile::ResolvConf => RESOLV_CONF_STR.read().unwrap(), _ => return_errno!(EINVAL, "Unsupported host file"), }; @@ -62,12 +62,12 @@ pub fn parse_host_file(host_file: HostFile, host_file_ptr: *const c_char) -> Res // Parse and inspect host file match host_file { - HostFile::HOSTS => { + HostFile::Hosts => { if let Err(_) = hosts_parser_util::parse_hosts_buffer(host_file_bytes) { return_errno!(EINVAL, "malformated host /etc/hosts"); } } - HostFile::HOSTNAME => match hosts_parser_util::parse_hostname_buffer(host_file_bytes) { + HostFile::HostName => match hosts_parser_util::parse_hostname_buffer(host_file_bytes) { Err(_) => { return_errno!(EINVAL, "malformated host /etc/hostname"); } @@ -75,7 +75,7 @@ pub fn parse_host_file(host_file: HostFile, host_file_ptr: *const c_char) -> Res return Ok(hostname_str); } }, - HostFile::RESOLV_CONF => { + HostFile::ResolvConf => { if let Err(_) = resolv_conf::Config::parse(host_file_bytes) { return_errno!(EINVAL, "malformated host /etc/resolv.conf"); } diff --git a/tools/copy_bom/Cargo.toml b/tools/copy_bom/Cargo.toml index 97a6c44c..98d90ab5 100644 --- a/tools/copy_bom/Cargo.toml +++ b/tools/copy_bom/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "copy_bom" version = "0.1.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tools/gen_internal_conf/Cargo.toml b/tools/gen_internal_conf/Cargo.toml index 4767e226..96a9272b 100644 --- a/tools/gen_internal_conf/Cargo.toml +++ b/tools/gen_internal_conf/Cargo.toml @@ -2,7 +2,7 @@ name = "gen_internal_conf" version = "0.2.0" authors = ["zongmin.gu "] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tools/init/Cargo.toml b/tools/init/Cargo.toml index a1903d46..7d75568d 100644 --- a/tools/init/Cargo.toml +++ b/tools/init/Cargo.toml @@ -2,7 +2,7 @@ name = "init" version = "0.0.1" authors = ["LI Qing geding.lq@antgroup.com"] -edition = "2018" +edition = "2021" [dependencies] libc = "0.2.84" diff --git a/tools/toolchains/dcap_lib/Cargo.lock b/tools/toolchains/dcap_lib/Cargo.lock index 701cfa9c..35a2c5f4 100644 --- a/tools/toolchains/dcap_lib/Cargo.lock +++ b/tools/toolchains/dcap_lib/Cargo.lock @@ -25,4 +25,4 @@ dependencies = [ [[package]] name = "sgx_types" -version = "1.1.4" +version = "1.1.5"