Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Incorrect pkglength can cause panic

Aperta
#362 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@mikamikasuki ci sta già lavorando.

Dal 2/10/2026.

  • #365 di @mikamikasuki — aperta

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

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-osdev/acpi

Tutte le issue di rust-osdev/acpi

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.