Skip to content

Commit 543bf2c

Browse files
committed
Fix up bug
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 2d522cc commit 543bf2c

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
@@ -674,6 +674,8 @@ mod tests {
674674
#[ignore]
675675
#[cfg(target_os = "linux")]
676676
fn test_violate_seccomp_filters() -> Result<()> {
677+
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
678+
677679
fn make_get_pid_syscall() -> Result<u64> {
678680
let pid = unsafe { libc::syscall(libc::SYS_getpid) };
679681
Ok(pid as u64)
@@ -697,7 +699,9 @@ mod tests {
697699
match res {
698700
Ok(_) => panic!("Expected to fail due to seccomp violation"),
699701
Err(e) => match e {
700-
HyperlightError::DisallowedSyscall => {}
702+
HyperlightError::GuestError(t, msg)
703+
if t == ErrorCode::HostFunctionError
704+
&& msg.contains("Seccomp filter trapped on disallowed syscall") => {}
701705
_ => panic!("Expected DisallowedSyscall error: {}", e),
702706
},
703707
}

0 commit comments

Comments
 (0)