Page MenuHomeFreeBSD

stand: Unbreak FAT32 in loader
ClosedPublic

Authored by grembo on Sep 7 2022, 5:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 14, 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
Unknown Object (File)
Sep 16 2024, 11:50 AM
Unknown Object (File)
Sep 11 2024, 3:52 PM
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 Not Applicable
Unit
Tests Not Applicable

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.