Translating vaddubm on big-endian PowerPC corrupts the heap and aborts
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- reverse-engineering
Direzione di ricerca
Inizia dal punto di ingresso pypcode.Context.translate e riproduci il caso vaddubm a quattro byte per PowerPC:BE:32:default e PowerPC:BE:64:default. Segui il percorso di traduzione PowerPC big-endian e confrontalo con il caso little-endian che non interrompe il processo. Il lavoro è completato quando un input vaddubm valido non corrompe più l'heap e non causa l'interruzione del processo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 222
- Fork
- 33
- Merge medio
- 7h 13m
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angr/pypcode
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
-
Update to Ghidra 12.1.2Forse di nuovo libera @mborgerson l’ha presa 126 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
-
Build with freethreadingApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di angr/pypcode
Issue simili
-
(S1 - Need confirmation)
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
CleverRaven/Cataclysm-DDA#89182 ·
I maintainer di solito rispondono entro 1 giorno
-
ai_p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ClickHouse/ClickHouse#126833 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Misc. bug: Missing range check on grammar_triggers[].type allows remote SIGABRT in llama-serverApertabug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
rocketride-org/rocketride-server#2705 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno