hyperlight-dev / hyperlight-dev/hyperlight

Replace generic HyperlightError::Error variant with specific error types to improve sandbox poisoning accuracy

オープン
#998 コメント 2 件 リアクション 0 件 担当者 1 名 @ludfjig が担当を希望しています GitHub で見る
area/security lifecycle/confirmed
主要言語
Rust
スター
4.7k
フォーク
208
平均マージ
1日 7時間
マージ済み PR(30日)
47

説明

The sandbox poisoning mechanism relies on accurate error information and strong typing to determine when a sandbox has entered an inconsistent state requiring recovery. Currently, the `HyperlightError::Error` variant is a generic catch-all error type that can be created using the `new_error!` macro.

The problem is that `HyperlightError::Error` can be (and is) used for situations that should poison the sandbox, but the error type doesn't provide enough information for the poisoning logic to make the correct determination. This creates a safety hole where:

- Critical errors that leave the sandbox in an inconsistent state might be wrapped in generic error variants
- The poisoning mechanism cannot distinguish between benign errors and those that compromise sandbox state
- Sandboxes that should be poisoned may continue to be used

## Solution
Replace all instances of `HyperlightError::Error` with specific, strongly-typed error variants that accurately describe the error condition.

As an aside, we should probably distinguish between internal errors and public errors. Right now all errors are pub because they all are part of the same enum. I think splitting errors by something like file/module/struct/method is a good idea in general.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。