Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#292 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, python

Línea de trabajo

Comienza en el punto de entrada pypcode.Context.translate y reproduce el caso vaddubm de cuatro bytes para PowerPC:BE:32:default y PowerPC:BE:64:default. Sigue la ruta de traducción big-endian de PowerPC y compárala con el caso little-endian que no provoca una interrupción. Se considera terminado cuando una entrada vaddubm válida ya no corrompe el heap ni provoca la interrupción del proceso.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C++
Estrellas
224
Forks
33
Merge medio
7 h 18 min
PR fusionados (30 d)
10

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angr/pypcode

Todos los issues de angr/pypcode

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.