Incorrect pkglength can cause panic
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- operating-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 248
- Fork
- 95
- Merge medio
- 3g 14h
- PR unite (30g)
- 9
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 rust-osdev/acpi
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
rust-osdev/acpi#366 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
rust-osdev/acpi#354 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
rust-osdev/acpi#353 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rust-osdev/acpi#336 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
rust-osdev/acpi#328 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di rust-osdev/acpi
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
area:sim good first issue kind:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
bitcoindevkit/bdk#2432 ·
I maintainer di solito rispondono entro 3 giorni
-
The demo's interval button and chart legend keep the previous interval after an interval changeApertabug ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
userFRM/egui-charts#670 ·
I maintainer di solito rispondono entro 1 giorno
-
docs good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
Usenova-Labs/usenova-backend#35 ·
I maintainer di solito rispondono entro 1 giorno