Skip to content

Commit fc3b377

Browse files
committed
Fix up bug
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 8b1fcd2 commit fc3b377

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/hyperlight_common/src/flatbuffer_wrappers/guest_error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ impl From<FbErrorCode> for ErrorCode {
9696
}
9797
FbErrorCode::GuestError => Self::GuestError,
9898
FbErrorCode::ArrayLengthParamIsMissing => Self::ArrayLengthParamIsMissing,
99+
FbErrorCode::HostError => Self::HostFunctionError,
99100
_ => Self::UnknownError,
100101
}
101102
}

src/hyperlight_host/src/sandbox/initialized_multi_use.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ mod tests {
645645
#[ignore]
646646
#[cfg(target_os = "linux")]
647647
fn test_violate_seccomp_filters() -> Result<()> {
648+
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
649+
648650
fn make_get_pid_syscall() -> Result<u64> {
649651
let pid = unsafe { libc::syscall(libc::SYS_getpid) };
650652
Ok(pid as u64)
@@ -668,7 +670,9 @@ mod tests {
668670
match res {
669671
Ok(_) => panic!("Expected to fail due to seccomp violation"),
670672
Err(e) => match e {
671-
HyperlightError::DisallowedSyscall => {}
673+
HyperlightError::GuestError(t, msg)
674+
if t == ErrorCode::HostFunctionError
675+
&& msg.contains("Seccomp filter trapped on disallowed syscall") => {}
672676
_ => panic!("Expected DisallowedSyscall error: {}", e),
673677
},
674678
}

0 commit comments

Comments
 (0)