Incorrect pkglength can cause panic
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 248
- Fork
- 95
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-osdev/acpi
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rust-osdev/acpi#366 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
rust-osdev/acpi#354 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
rust-osdev/acpi#353 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
rust-osdev/acpi#336 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
rust-osdev/acpi#328 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của rust-osdev/acpi
Issue tương tự
-
documentation priority:p2 type:chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
dispatch:sol-high documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
carrick-sh/carrick#768 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
correctness postgres tursopg
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
tursodatabase/turso#10442 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Incorrect "Share Decks" linkĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
ankitects/anki#5864 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area: config effort: S good first issue P3 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ferenyl/azuredevopstui#63 ·