File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
hyperlight_common/src/flatbuffer_wrappers
hyperlight_host/src/sandbox Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ impl From<FbErrorCode> for ErrorCode {
96
96
}
97
97
FbErrorCode :: GuestError => Self :: GuestError ,
98
98
FbErrorCode :: ArrayLengthParamIsMissing => Self :: ArrayLengthParamIsMissing ,
99
+ FbErrorCode :: HostError => Self :: HostFunctionError ,
99
100
_ => Self :: UnknownError ,
100
101
}
101
102
}
Original file line number Diff line number Diff line change @@ -645,6 +645,8 @@ mod tests {
645
645
#[ ignore]
646
646
#[ cfg( target_os = "linux" ) ]
647
647
fn test_violate_seccomp_filters ( ) -> Result < ( ) > {
648
+ use hyperlight_common:: flatbuffer_wrappers:: guest_error:: ErrorCode ;
649
+
648
650
fn make_get_pid_syscall ( ) -> Result < u64 > {
649
651
let pid = unsafe { libc:: syscall ( libc:: SYS_getpid ) } ;
650
652
Ok ( pid as u64 )
@@ -668,7 +670,9 @@ mod tests {
668
670
match res {
669
671
Ok ( _) => panic ! ( "Expected to fail due to seccomp violation" ) ,
670
672
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" ) => { }
672
676
_ => panic ! ( "Expected DisallowedSyscall error: {}" , e) ,
673
677
} ,
674
678
}
You can’t perform that action at this time.
0 commit comments