Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Incorrect pkglength can cause panic

オープン
#362 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@mikamikasuki がすでに取り組んでいます。

2026年10月2日 から。

  • #365 @mikamikasuki による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
248
フォーク
95
平均マージ
3日 14時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-osdev/acpi のほかの issue

rust-osdev/acpi の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。