rust-osdev / bootloader

An experimental pure-Rust x86 bootloader
Apache License 2.0
1.36k stars 206 forks source link

Fix invalid mapping to zero page caused by off-by-one bug #424

Closed phil-opp closed 7 months ago

phil-opp commented 7 months ago

The zero_end bound is exclusive, but we treat the end_page as inclusive. So when zero_end is page-aligned, we allocate one additional bss page. If this page was already mapped to some other segment, we remap it to a page with random content.

This is the same bug as https://github.com/rust-osdev/bootloader/pull/362.

Fixes https://github.com/phil-opp/blog_os/issues/1297

phil-opp commented 7 months ago

Published as v0.9.27 :rocket:

vinc commented 7 months ago

Hi @phil-opp, thanks for the recent updates on the v0.9 branch! :rocket:

There's a little issue with this last one, it should have removed the unused imports Translate and TranslateResult that were introduced by the previous one (#423) because they are now causing a warning during compilation.

Would you like a quick PR fixing that?

phil-opp commented 7 months ago

Ah, I missed that. Yes, a PR against the v0.9-base branch would be appreciated!

vinc commented 7 months ago

Great, working on it!