JIT shim object drops GNU property notes (CET/BTI/PAC) from output binaries
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
When building with --enable-experimental-jit the jit_shim.o object lacks GNU property notes for hardware security features. The linker removes all such properties from the output binaries when any input object lacks them.
The regression was introduced with 9633c5239daa which makes the shim being compiled as a regular object file.
You can reproduce it by using ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j.
Before the aforementioned commit a readelf -n python | grep 'x86 feature' would show Properties: x86 feature: IBT, SHSTK, whereas now nothing.
This is the case as well for BTI/PAC/GCS for aarch64 when building with https://github.com/python/cpython/pull/130864 and -mbranch-protection=standard.
My testing included GCC15.2.1 for the interpreter and Clang 21.1.8 for the jit, on Fedora 43.
CPython versions tested on:
3.16, CPython main branch, 3.15
Operating systems tested on:
Linux
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先使用 ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j 重現此問題,然後使用 readelf -n 檢查 JIT shim 物件和產生的 python 二進位檔。追蹤 commit 9633c5239daa 之後 jit_shim.o 如何作為一般物件建置。對於回報的 x86 和 aarch64 安全功能,GNU property notes 仍保留在輸出二進位檔中,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, linux, python
- 領域
- build-system, compilers, security
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100