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 {
9696 }
9797 FbErrorCode :: GuestError => Self :: GuestError ,
9898 FbErrorCode :: ArrayLengthParamIsMissing => Self :: ArrayLengthParamIsMissing ,
99+ FbErrorCode :: HostError => Self :: HostFunctionError ,
99100 _ => Self :: UnknownError ,
100101 }
101102 }
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments