python / python/cpython

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

Aberta
#149,697 5 comentários 1 reação 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

interpreter-core topic-JIT type-bug
Linguagem predominante
Python
Estrelas
77.2k
Forks
35.9k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece reproduzindo o problema com ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j e, em seguida, inspecione o objeto shim do JIT e o binário python resultante com readelf -n. Rastreie como jit_shim.o é compilado como um objeto regular após o commit 9633c5239daa. Está concluído quando as GNU property notes permanecem nos binários de saída para os recursos de segurança x86 e aarch64 relatados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
c, linux, python
Domínio
build-system, compilers, security
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.