Page MenuHomeFreeBSD

stand: Unbreak FAT32 in loader
ClosedPublic

Authored by grembo on Sep 7 2022, 5:23 PM.
Tags
None
Referenced Files
F103562525: D36482.diff
Tue, Nov 26, 1:31 PM
Unknown Object (File)
Thu, Nov 14, 1:04 PM
Unknown Object (File)
Oct 14 2024, 6:15 AM
Unknown Object (File)
Sep 24 2024, 11:26 PM
Unknown Object (File)
Sep 24 2024, 7:38 AM
Unknown Object (File)
Sep 18 2024, 7:05 AM
Unknown Object (File)
Sep 17 2024, 3:53 PM
Unknown Object (File)
Sep 17 2024, 12:06 AM
Subscribers

Details

Summary

This corrects an issue introduced in b4cb3fe0e39a3, where a freshly
allocated DOS_FS structure would not be initialized properly before
use in dos_open.

In case of FAT32 file systems, this would leave fs->dirents
uninitialized and - depending on its content and due to checks in
parsebs - prevent mounting the file system successfully.

This particularily impacted the EFI loader, as it was sometimes not
able to read files from a FAT32-formatted EFI partition, including
LoaderEnv (/efi/freebsd/loader.env).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47283
Build 44170: arc lint + arc unit

Event Timeline

grembo requested review of this revision.Sep 7 2022, 5:23 PM
grembo added inline comments.
stand/libsa/dosfs.c
605

FAT32 enters this block (so fs->dirents isn't initialized).

619

And - depending on circumstances - this check will fail.

Cool! Thanks for tracking this all the way down...

This revision is now accepted and ready to land.Sep 7 2022, 11:30 PM
This revision was automatically updated to reflect the committed changes.