Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Translating vaddubm on big-endian PowerPC corrupts the heap and aborts

オープン
#292 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, python

調査の方向性

エントリポイント 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

angr/pypcode のほかの issue

angr/pypcode の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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