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)
Sat, May 4, 4:20 AM
Unknown Object (File)
Dec 23 2023, 2:08 AM
Unknown Object (File)
Dec 12 2023, 4:06 PM
Unknown Object (File)
Dec 8 2023, 4:31 PM
Unknown Object (File)
Dec 8 2023, 4:18 PM
Unknown Object (File)
Sep 19 2023, 12:03 AM
Unknown Object (File)
Sep 18 2023, 11:57 PM
Unknown Object (File)
Sep 18 2023, 11:56 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.