Incorrect pkglength can cause panic
Los mantenedores suelen responder en 2 días
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
- Área
- operating-systems
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-osdev/acpi
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
rust-osdev/acpi#366 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
rust-osdev/acpi#354 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
rust-osdev/acpi#353 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
rust-osdev/acpi#336 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
rust-osdev/acpi#328 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de rust-osdev/acpi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
good first issue help wanted r-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
servo/rust-smallvec#792 ·
Los mantenedores suelen responder en 1 día
-
A-Unicode C-bug P-low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rust-lang/rustfmt#7210 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
callTracer with withLog: true includes logs from a reverted top-level call (diverges from geth)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
paradigmxyz/revm-inspectors#570 ·
Los mantenedores suelen responder en 1 día