Sleigh segfaults on short inputs for JVM, NDS32 and SPARC
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
まず、JVM、NDS32、SPARC について、コミット 559aacdc における、提供された 3 つの pypcode.Context.translate 呼び出しを再現します。各失敗を、関連する SLEIGH 言語定義と入力処理を通して追跡し、SPARC のシーケンスは 1 回の translate 呼び出しにまとめたままにします。3 つすべての入力が segfault なしで戻り、パッチに対して再テストできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Three Sleigh language definitions segfault on short byte sequences. They are
almost certainly three separate defects and can be split if that is easier to
triage — they are together here because they came out of one survey and share a
shape: a small input, no exception, the process gone.
All three reproduce on 559aacdc, which is master at the time of writing, and
each is a bare translate call with no other state.
1. JVM — tableswitch
pypcode.Context("JVM:BE:32:default").translate(
bytes.fromhex("aa873b8e6f50b409"), 0x1001,
max_instructions=99999, max_bytes=8,
flags=pypcode.TranslateFlags.BB_TERMINATING)
0xaa is tableswitch; 0xab (lookupswitch) fails the same way. Eight bytes.
2. NDS32
pypcode.Context("NDS32:LE:32:default").translate(
bytes.fromhex("26095d273add"), 0x1010,
max_instructions=99999, max_bytes=6,
flags=pypcode.TranslateFlags.BB_TERMINATING)
Six bytes.
3. SPARC
pypcode.Context("sparc:BE:32:default").translate(
bytes.fromhex("1728394a5b6c7d8e9fb0c1d2b01e0019"), 0x14,
max_instructions=99999, max_bytes=16,
flags=pypcode.TranslateFlags.BB_TERMINATING)
This one needs the whole run in a single translate call — no individual word
in that sequence crashes on its own, which I checked.
How much weight to put on these
Less than on the PowerPC report I opened alongside this one, and I would rather
say so than oversell. That case is an ordinary vaddubm that a compiler emits,
and it corrupts the heap. These three are short sequences that do not correspond
to code any toolchain produces, so they are robustness findings rather than
something a user meets on real input.
They still seem worth having. A lifter is routinely pointed at binaries whose
provenance is unknown, and there the distinction between "valid code" and
"arbitrary bytes" does not hold — the caller cannot know which it has until
after the lift, and a segfault gives no opportunity to skip the block.
I have not attempted fixes and am not proposing any. Happy to retest against a
patch.
- 主要言語
- C++
- スター
- 222
- フォーク
- 33
- 平均マージ
- 7時間 13分
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angr/pypcode のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
-
Update to Ghidra 12.1.2再び着手できるかも @mborgerson が 126 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
needs-format
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Niko1221/Strata#3368 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
dragonflydb/dragonfly#8617 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
project-chip/connectedhomeip#74842 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
smartmontools/smartmontools#670 ·
メンテナーはふだん 1 日以内に返信