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