JIT shim object drops GNU property notes (CET/BTI/PAC) from output binaries
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j, then inspect the JIT shim object and the resulting python binary with readelf -n. Trace how jit_shim.o is built as a regular object after commit 9633c5239daa. Done means GNU property notes remain in output binaries for the reported x86 and aarch64 security features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- build-system, compilers, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100