Skip to content

Commit 42cf582

Browse files
skehrlilgaeherwojciechozgawhensun
authored
Bump Rust + RefinedRust versions (#151)
* Bump: RefinedRust * fix * update dev instructions for compat with current toolchains * fix: add missing rr::skip annotations * ci: allow 0 pruned modules * bump: refinedrust * bump: rust toolchain and RefinedRust * bump(wip): refinedrust * wip: fix * fix: try_write * bump: refinedrust * bump: refinedrust * fix: merge * bump: toolchain * bump: refinedrust * fix: proofs * fix: adapt to new panic handling * bump: refinedrust * bump: refinedrust * bump refinedrust * bump: refinedrust * merge main, bump refinedrust * Add OOPSLA paper, update dependencies (#126) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Crypto dependency updates (#132) * update crypto dependencies to get rid of generic-array, use sha3-0.11 and upgrade ml-kem * formatting Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * update bindgen to 0.73, spin to 0.12, clap to 4.6 * update rand to 0.9 and generate random symmetric key and nonce in TAP serializer * update rand crate dependency to 0.10 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Update AES GCM to 0.11.1 Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Compliance with CodeQL (#139) * make codebase comliant with CodeQL scans * update and reduce dependencies * Fix Github CI --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix FPU register save and restore instructions (#143) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * Preallocate vector in copy_from_non_confidential_memory (#142) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Fix attestation secret release, key naming, and tests (#144) Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> * Increase ACE OpenSBI hart stack size to 16 KiB (#146) Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> * fix: bump ocaml compiler in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: disable opam sandboxing in verification CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * fix: enforce single-job Rocq compilation in CI Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> * bump: refinedrust and matching rust toolchain Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> Co-authored-by: Wojciech Ozga <woz@zurich.ibm.com> Co-authored-by: Whensun <143617993+whensun@users.noreply.github.com> * fix: explicitly enable H extension for security monitor builds Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> --------- Signed-off-by: Wojciech Ozga <woz@zurich.ibm.com> Signed-off-by: whensun <theodoruswensanfebruanto025@gmail.com> Signed-off-by: Sascha Kehrli <sascha.kehrli@gmail.com> Co-authored-by: Lennard Gäher <l.gaeher@posteo.de> Co-authored-by: Wojciech Ozga <woz@zurich.ibm.com> Co-authored-by: Whensun <143617993+whensun@users.noreply.github.com>
1 parent 7278c21 commit 42cf582

85 files changed

Lines changed: 257 additions & 244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/prune_dune_modules.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
import re
33
import sys
44

5-
if len(sys.argv) < 3:
6-
print("usage: prune_dune_modules.py <dune-file> <module1> [module2 ...]")
5+
if len(sys.argv) < 2:
6+
print("usage: prune_dune_modules.py <dune-file> [module1 module2 ...]")
77
sys.exit(1)
88

99
path = sys.argv[1]
10-
remove = set(sys.argv[2:])
10+
remove = set(sys.argv[2:]) # may be empty
11+
12+
# If nothing to remove, exit early (no-op)
13+
if not remove:
14+
sys.exit(0)
1115

1216
with open(path) as f:
1317
text = f.read()

‎.github/workflows/verify.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- name: Install opam
2222
run: curl "https://github.com/ocaml/opam/releases/download/2.5.0/opam-2.5.0-x86_64-linux" -Lo /usr/local/bin/opam && chmod +x /usr/local/bin/opam
2323
- name: Setup opam
24-
run: opam init -y
24+
run: opam init -y --disable-sandboxing
2525
- name: Setup opam switch
26-
run: opam switch create refinedrust-ace --packages=ocaml-variants.4.14.1+options,ocaml-option-flambda
26+
run: opam switch create refinedrust-ace --packages=ocaml-variants.4.14.2+options,ocaml-option-flambda
2727
- name: ls
2828
run: ls -la .
2929
- name: Install openssl dependency
@@ -81,7 +81,7 @@ jobs:
8181
source "$HOME/.cargo/env"
8282
eval "$(opam env)"
8383
cd verification
84-
DUNEFLAGS="-j 1 --display verbose" dune build
84+
dune build -j 1 --display verbose
8585
) 2>&1 | tee full-build.log
8686
- name: Upload full build log
8787
if: always()

‎DEVELOPMENT.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Set environment variables to use the RISC-V toolchain:
2222
export RISCV_GNU_TOOLCHAIN_WORK_DIR=`brew --prefix riscv-gnu-toolchain`
2323
export PATH=$RISCV_GNU_TOOLCHAIN_WORK_DIR/bin:$PATH
2424
export CROSS_COMPILE=riscv64-unknown-elf-
25+
export GENFLAGS="-std=gnu17"
2526
```
2627

2728
Build the security monitor:
@@ -197,4 +198,4 @@ Finally perform an online resize to resize the logical volume, then check the av
197198
# xfs_growfs or resize2fs!
198199
sudo xfs_growfs /dev/mapper/fedora_fedora-root
199200
df -h
200-
```
201+
```

‎rust-toolchain.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2026-03-23"
2+
channel = "nightly-2026-11-15"
33
targets = [ "riscv64gc-unknown-none-elf" ]

‎security-monitor/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CARGO = cargo
66
RELEASE = --release
77
CHAIN=riscv64gc-unknown-none-elf
88
TARGET = --target=$(CHAIN)
9-
RUSTFLAGS = -Clink-arg=-Tsrc/platform/qemu/virt.lds -Crelocation-model=pie #-Ccode-model=medium
9+
RUSTFLAGS = -Clink-arg=-Tsrc/platform/qemu/virt.lds -Crelocation-model=pie -Ctarget-feature=+h #-Ccode-model=medium
1010
EXEC_NAME = libace.a
1111
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
1212
MAKEFILE_SOURCE_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

‎security-monitor/src/core/architecture/riscv/mmu/page_table_level.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// Safety:
66
// - Maintain lexicographic ordering based on the top-to-bottom declaration to ensure that PartialOrd derivative works correctly.
7+
#[rr::skip] // TODO: needs attributes for trait impls
78
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
89
#[rr::refined_by("page_table_level")]
910
pub enum PageTableLevel {

‎security-monitor/src/core/control_data/confidential_vm_id.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-FileContributor: Wojciech Ozga <woz@zurich.ibm.com>, IBM Research - Zurich
33
// SPDX-License-Identifier: Apache-2.0
44

5+
#[rr::skip]
56
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone, Debug)]
67
pub struct ConfidentialVmId(usize);
78

‎security-monitor/src/core/memory_layout/confidential_memory_address.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use pointers_utility::{ptr_byte_add_mut, ptr_byte_offset};
88
/// The wrapper over a raw pointer that is guaranteed to be an address located in the confidential memory region.
99
#[repr(transparent)]
1010
#[derive(Debug, PartialEq, Clone, Copy)]
11+
#[rr::derive_instantiate("PEq" := "λ a b, bool_decide (a.(loc_a) = b.(loc_a))")]
1112
/// Model: The memory address is represented by the location in memory.
1213
#[rr::refined_by("l" : "loc")]
1314
/// We require the ghost state for the global memory layout to be available.
@@ -17,7 +18,7 @@ use pointers_utility::{ptr_byte_add_mut, ptr_byte_offset};
1718
#[rr::invariant(#iris "once_status \"MEMORY_LAYOUT\" (Some MEMORY_CONFIG)")]
1819
/// Invariant: The address is in the confidential part of the memory layout.
1920
#[rr::invariant("(MEMORY_CONFIG.(conf_start).(loc_a) ≤ l.(loc_a) < MEMORY_CONFIG.(conf_end).(loc_a))%Z")]
20-
pub struct ConfidentialMemoryAddress(#[rr::field("l")] *mut usize);
21+
pub struct ConfidentialMemoryAddress(#[rr::field("#l")] *mut usize);
2122

2223
/// Verification: We require the ghost state for the global memory layout to be available.
2324
#[rr::context("onceG Σ memory_layout")]

‎security-monitor/src/core/memory_layout/confidential_vm_physical_address.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0
44
use crate::error::Error;
55

6+
#[rr::skip]
67
#[derive(PartialEq, PartialOrd, Clone, Copy)]
78
pub struct ConfidentialVmPhysicalAddress(usize);
89

‎security-monitor/src/core/memory_layout/mod.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ static MEMORY_LAYOUT: Once<MemoryLayout> = Once::new();
3737
#[rr::invariant("ml.(conf_start) `aligned_to` (page_size_in_bytes_nat Size4KiB)")]
3838
#[rr::invariant("ml.(conf_end) `aligned_to` (page_size_in_bytes_nat Size4KiB)")]
3939
pub struct MemoryLayout {
40-
#[rr::field("ml.(non_conf_start)")]
40+
#[rr::field("# ml.(non_conf_start)")]
4141
non_confidential_memory_start: *mut usize,
42-
#[rr::field("ml.(non_conf_end)")]
42+
#[rr::field("# ml.(non_conf_end)")]
4343
non_confidential_memory_end: *const usize,
44-
#[rr::field("ml.(conf_start)")]
44+
#[rr::field("# ml.(conf_start)")]
4545
confidential_memory_start: *mut usize,
46-
#[rr::field("ml.(conf_end)")]
46+
#[rr::field("# ml.(conf_end)")]
4747
confidential_memory_end: *const usize,
4848
}
4949

0 commit comments

Comments
 (0)