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

Incorrect pkglength can cause panic

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

Los mantenedores suelen responder en 2 días

@mikamikasuki ya está trabajando en esto.

Desde el 2/10/2026.

  • #365 de @mikamikasuki — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start at src/aml/mod.rs:784:25 and reproduce the panic with faulty.aml.txt or dump FC552E246162. Trace package parsing for the over-long pkglength, then verify that parsing uses the package element count and continues to the following BBBB definition without panicking.

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

Descripción

I discovered this by attempting to load all of the uACPI dump files.

A handful fail with this error (e.g. dump FC552E246162):

thread 'main' (49596) panicked at [xxx]\src\aml\mod.rs:784:25:
assertion `left == right` failed
  left: Ok(8)
 right: Err(RunOutOfStream)

It turns out that these files encode packages where the pkglength field has a value greater than the actual length of the package. So, for example (in encoded AML)

08          // Def Name
41 41 41 41 // AAAA
12          // Def Package
0a  // <------ Package Length - this line is wrong, should be 06
02          // 2 elements 
0a a1       // Element 1
0a a2       // Element 2
08          // Def Name
42 42 42 42 // BBBB
12          // Def Package
06          // 6 bytes
02          // 2 elements
0a b1       // element 1
0a b2       // element 2

(File attached as well - faulty.aml.txt)

This loosely corresponds to the following ASL, but with the pkglength of AAAA edited:

DefinitionBlock("", "DSDT", 1, "RSACPI", "PKGLEN", 1) {
    Name(AAAA, Package(2) { 0xa1, 0xa2 })
    Name(BBBB, Package(2) { 0xb1, 0xb2 })
}

I'm aware there are various places where incorrect AML can cause panics, and that we already know that. I flag this specific example because it's the only one we currently hit by loading all of the uACPI dumps - so it's 🤞 the only significant one we might hit in the wild.

What do the other interpreters do?

  • uACPI fails to load the rest of the table, but otherwise carries on OK
  • ACPICA loads the entire table successfully - I assume it relies on the package element count, rather than the pkglength field.

I assume that Windows does as ACPICA does, otherwise the original firmware developers would have spotted the problem, but I haven't checked.

I propose to adjust our code to allow over-long pkglength fields by relying on the package count.

O/T, but this may be a good place to add some kind of AcpiWarning system.

Lenguaje dominante
Rust
Estrellas
248
Forks
95
Merge medio
3 d 14 h
PR fusionados (30 d)
9

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 rust-osdev/acpi

Todos los issues de rust-osdev/acpi

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.