python / python/cpython

JIT shim object drops GNU property notes (CET/BTI/PAC) from output binaries

Aperta
#149,697 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

interpreter-core topic-JIT type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il problema con ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j, quindi esamina l'oggetto shim del JIT e il binario python risultante con readelf -n. Traccia il modo in cui jit_shim.o viene compilato come oggetto regolare dopo il commit 9633c5239daa. Il lavoro è completato quando le GNU property notes rimangono nei binari di output per le funzionalità di sicurezza x86 e aarch64 segnalate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, linux, python
Ambito
build-system, compilers, security
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.