Skip to content

fix: Do unaligned reads for table entries - #364

Merged
martin-hughes merged 1 commit into
rust-osdev:mainfrom
mkroening:unaligned-table-entries
Oct 2, 2026
Merged

martin-hughes merged 1 commit into
rust-osdev:mainfrom
mkroening:unaligned-table-entries

Conversation

@mkroening

Copy link
Copy Markdown
Member

After migrating Hermit to this crate, I faced some rare crashes in some configurations. Specifically, there are sometimes panics due to unaligned reads when reading table entries. As far as I know, this QEMU behavior is legal, since I could not find any alignment guarantees in the ACPI spec.

This PR fixes the specific issue that I hit. There might be other places in this crate, though, where alignment is incorrectly assumed.

@martin-hughes

Copy link
Copy Markdown
Contributor

Good spot, thanks @mkroening!

I suspect you're right - I have a feeling that any of the raw pointer reads could be misaligned. I'll bear it in mind when I'm looking at things.

@martin-hughes
martin-hughes merged commit 9b73dd9 into rust-osdev:main Oct 2, 2026
6 checks passed
@mkroening
mkroening deleted the unaligned-table-entries branch October 2, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants