python / python/cpython

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

オープン
#149,697 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

interpreter-core topic-JIT type-bug
主要言語
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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず ./configure --enable-experimental-jit=yes-off CFLAGS="-fcf-protection" && make -j で問題を再現し、次に JIT shim オブジェクトと生成された python バイナリを readelf -n で調べます。コミット 9633c5239daa 後に jit_shim.o が通常のオブジェクトとしてビルドされる仕組みを追跡します。報告されている x86 および aarch64 のセキュリティ機能について、GNU property notes が出力バイナリに残ることが完了条件です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, linux, python
領域
build-system, compilers, security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。