Skip to main content

HyperlightError

Type Alias HyperlightError 

Source
pub type HyperlightError = HyperlightError;
Expand description

The error type for Hyperlight operations

Aliased Type§

pub enum HyperlightError {
Show 49 variants AnyhowError(Error), BoundsCheckFailed(u64, usize), CheckedAddOverflow(u64, u64), CStringConversionError(NulError), Error(String), ExecutionAccessViolation(u64), ExecutionCanceledByHost(), FailedToGetValueFromParameter(), FieldIsMissingInGuestLogData(String), GuestAborted(u8, String), GuestError(ErrorCode, String), GuestExecutionHungOnHostFunctionCall(), GuestFunctionCallAlreadyInProgress(), GuestInterfaceUnsupportedType(String), GuestOffsetIsInvalid(usize), HostFunctionNotFound(String), IOError(Error), IntConversionFailure(TryFromIntError), InvalidFlatBuffer(InvalidFlatbuffer), JsonConversionFailure(Error), KVMError(Error), LockAttemptFailed(String), MemoryAccessViolation(u64, MemoryRegionFlags, MemoryRegionFlags), MemoryAllocationFailed(Option<i32>), MemoryProtectionFailed(Option<i32>), MemoryRequestTooBig(usize, usize), MetricNotFound(&'static str), MmapFailed(Option<i32>), MprotectFailed(Option<i32>), MSHVError(MshvError), NoHypervisorFound(), NoMemorySnapshot, ParameterValueConversionFailure(ParameterValue, &'static str), PEFileProcessingFailure(Error), PoisonedSandbox, RawPointerLessThanBaseAddress(RawPtr, u64), RefCellBorrowFailed(BorrowError), RefCellMutBorrowFailed(BorrowMutError), ReturnValueConversionFailure(ReturnValue, &'static str), StackOverflow(), SnapshotSandboxMismatch, SystemTimeError(SystemTimeError), TryFromSliceError(TryFromSliceError), UnexpectedNoOfArguments(usize, usize), UnexpectedParameterValueType(ParameterValue, String), UnexpectedReturnValueType(ReturnValue, String), UTF8StringConversionFailure(FromUtf8Error), VectorCapacityIncorrect(usize, usize, i32), VmmSysError(Error),
}

Variants§

§

AnyhowError(Error)

Anyhow error

§

BoundsCheckFailed(u64, usize)

Memory access out of bounds

§

CheckedAddOverflow(u64, u64)

Checked Add Overflow

§

CStringConversionError(NulError)

CString conversion error

§

Error(String)

A generic error with a message

§

ExecutionAccessViolation(u64)

Execution violation

§

ExecutionCanceledByHost()

Guest execution was cancelled by the host

§

FailedToGetValueFromParameter()

Accessing the value of a flatbuffer parameter failed

§

FieldIsMissingInGuestLogData(String)

Field Name not found in decoded GuestLogData

§

GuestAborted(u8, String)

Guest aborted during outb

§

GuestError(ErrorCode, String)

Guest call resulted in error in guest

§

GuestExecutionHungOnHostFunctionCall()

An attempt to cancel guest execution failed because it is hanging on a host function call

§

GuestFunctionCallAlreadyInProgress()

Guest call already in progress

§

GuestInterfaceUnsupportedType(String)

The given type is not supported by the guest interface.

§

GuestOffsetIsInvalid(usize)

The guest offset is invalid.

§

HostFunctionNotFound(String)

A Host function was called by the guest but it was not registered.

§

IOError(Error)

Reading Writing or Seeking data failed.

§

IntConversionFailure(TryFromIntError)

Failed to convert to Integer

§

InvalidFlatBuffer(InvalidFlatbuffer)

The flatbuffer is invalid

§

JsonConversionFailure(Error)

Conversion of str to Json failed

§

KVMError(Error)

KVM Error Occurred

§

LockAttemptFailed(String)

An attempt to get a lock from a Mutex failed.

§

MemoryAccessViolation(u64, MemoryRegionFlags, MemoryRegionFlags)

Memory Access Violation at the given address. The access type and memory region flags are provided.

§

MemoryAllocationFailed(Option<i32>)

Memory Allocation Failed.

§

MemoryProtectionFailed(Option<i32>)

Memory Protection Failed

§

MemoryRequestTooBig(usize, usize)

The memory request exceeds the maximum size allowed

§

MetricNotFound(&'static str)

Metric Not Found.

§

MmapFailed(Option<i32>)

mmap Failed.

§

MprotectFailed(Option<i32>)

mprotect Failed.

§

MSHVError(MshvError)

mshv Error Occurred

§

NoHypervisorFound()

No Hypervisor was found for Sandbox.

§

NoMemorySnapshot

Restore_state called with no valid snapshot

§

ParameterValueConversionFailure(ParameterValue, &'static str)

Failed to get value from parameter value

§

PEFileProcessingFailure(Error)

a failure occurred processing a PE file

§

PoisonedSandbox

The sandbox becomes poisoned when the guest is not run to completion, leaving it in an inconsistent state that could compromise memory safety, data integrity, or security.

§When Does Poisoning Occur?

Poisoning happens when guest execution is interrupted before normal completion:

  • Guest panics or aborts - When a guest function panics, crashes, or calls abort(), the normal cleanup and unwinding process is interrupted
  • Invalid memory access - Attempts to read/write/execute memory outside allowed regions
  • Stack overflow - Guest exhausts its stack space during execution
  • Heap exhaustion - Guest runs out of heap memory
  • Host-initiated cancellation - Calling [InterruptHandle::kill()] to forcefully terminate an in-progress guest function
§Recovery

Use [crate::MultiUseSandbox::restore()] to recover from a poisoned sandbox.

§

RawPointerLessThanBaseAddress(RawPtr, u64)

Raw pointer is less than base address

§

RefCellBorrowFailed(BorrowError)

RefCell borrow failed

§

RefCellMutBorrowFailed(BorrowMutError)

RefCell mut borrow failed

§

ReturnValueConversionFailure(ReturnValue, &'static str)

Failed to get value from return value

§

StackOverflow()

Stack overflow detected in guest

§

SnapshotSandboxMismatch

Tried to restore snapshot to a sandbox that is not the same as the one the snapshot was taken from

§

SystemTimeError(SystemTimeError)

SystemTimeError

§

TryFromSliceError(TryFromSliceError)

Error occurred converting a slice to an array

§

UnexpectedNoOfArguments(usize, usize)

A function was called with an incorrect number of arguments

§

UnexpectedParameterValueType(ParameterValue, String)

The parameter value type is unexpected

§

UnexpectedReturnValueType(ReturnValue, String)

The return value type is unexpected

§

UTF8StringConversionFailure(FromUtf8Error)

Slice conversion to UTF8 failed

§

VectorCapacityIncorrect(usize, usize, i32)

The capacity of the vector is incorrect

§

VmmSysError(Error)

vmm sys Error Occurred