Translating vaddubm on big-endian PowerPC corrupts the heap and aborts
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
エントリポイント pypcode.Context.translate から開始し、PowerPC:BE:32:default と PowerPC:BE:64:default の 4 バイトの vaddubm ケースを再現します。big-endian の PowerPC 変換パスを追跡し、プロセスを中断しない little-endian のケースと比較します。完了条件は、有効な vaddubm 入力によってヒープが破壊されたり、プロセスが中断されたりしなくなることです。
索引モデルが issue の本文から書いたものです。
説明
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Translating a single ordinary AltiVec instruction corrupts the heap and aborts
the process. Four bytes are enough, and the input is valid PowerPC — not
malformed or random data.
import pypcode
pypcode.Context("PowerPC:BE:32:default").translate(
b"\x10\x00\x00\x00", 0x1000,
max_instructions=99999, max_bytes=4,
flags=pypcode.TranslateFlags.BB_TERMINATING,
)
The process dies with SIGABRT and glibc reports heap corruption — variously
free(): invalid size and corrupted size vs. prev_size, which indicates an
out-of-bounds write rather than a bad read.
On big-endian PowerPC, 10 00 00 00 decodes as vaddubm v0,v0,v0 — vector add
unsigned byte modulo, an unremarkable AltiVec instruction that a compiler will
emit for ordinary vectorised code.
What I verified
| language | result |
|---|---|
PowerPC:BE:32:default |
SIGABRT, heap corruption reported by glibc |
PowerPC:BE:64:default |
SIGABRT, heap corruption reported by glibc |
PowerPC:LE:32:default |
no abort — those bytes are not vaddubm in this byte order |
So the trigger tracks the instruction rather than the language variant, as one
would expect.
This is current master: the checkout used is 559aacdc, which is master at
the time of writing, and it also reproduces on the released 4.0.0 wheel from
PyPI in a clean virtual environment, so it does not depend on a source build.
Why it is worth attention
Any consumer that lifts PowerPC through Sleigh can be killed outright by four
bytes of legitimate input, with no exception to catch and no opportunity to skip
the block. It surfaced during a survey of a large binary corpus, where it
accounted for a small number of objects only because most PowerPC there routes
through a different lifter — the object count understates the exposure rather
than bounding it.
I have not attempted a fix, and I am not proposing one here; the report is the
contribution. Happy to test a patch against the same input if that helps.
- 主要言語
- C++
- スター
- 223
- フォーク
- 33
- 平均マージ
- 7時間 18分
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angr/pypcode のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
メンテナーはふだん 1 日以内に返信
-
Update to Ghidra 12.1.2再び着手できるかも @mborgerson が 131 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
extended_stabilizer: `std::pow(2, p/2.)` in `scalar_t::to_complex()` takes ~40% of runtime on Linux対応中かも @mehmetniyazikayi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Qiskit/qiskit-aer#2502 ·
メンテナーはふだん 1 日以内に返信
-
Test failure on FreeBSD: #26 unexpected system_clock source対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンlow priority rt_lib tests
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
RobLoach/raylib-cpp#440 · コメント 2 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信