hyperlight-dev / hyperlight-dev/hyperlight

Self-modifying code should crash on modification

未關閉
#562 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/security lifecycle/confirmed
主要語言
Rust
星號
4.7k
分支
208
平均合併
1 天 7 小時
30 天內合併 PR
48

描述

### What happened?

For defense in depth, attempts to write to code segments should abort the guest.

### What did you expect to happen?

I expected a crash, but instead the modification was successful.

### Steps to reproduce the behavior

The following test should crash when run in a guest:

```c
void victim() {}

void should_crash() {
void (*victim_ptr)() = victim;
*((char *)victim_ptr) = 0;
}
```

### Hyperlight Version

0.5.1

### OS version

```console
$ cat /etc/os-release
NAME="Microsoft Azure Linux"
VERSION="3.0.20250521"
ID=azurelinux
VERSION_ID="3.0"
PRETTY_NAME="Microsoft Azure Linux 3.0"
ANSI_COLOR="1;34"
HOME_URL="https://aka.ms/azurelinux"
BUG_REPORT_URL="https://aka.ms/azurelinux"
SUPPORT_URL="https://aka.ms/azurelinux"
$ uname -a
Linux 75b2257d5bbb 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux````

### Additional Information

_No response_

貢獻指南

開啟貢獻指南

研究方向

首先執行提供的 guest reproducer,使用 victim 和 should_crash 進入點,並檢查 guest 寫入程式碼區段時的處理方式。預期結果是,透過 victim_ptr 寫入會中止 guest,而不是成功修改程式碼;payload 未指定任何儲存庫檔案或測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
c, rust
領域
operating-systems, security
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。