Page MenuHomeFreeBSD

msdosfs: replace '/' in direntries with '?'
ClosedPublic

Authored by kib on Jul 17 2025, 1:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 12:03 AM
Unknown Object (File)
Sat, Oct 11, 12:03 AM
Unknown Object (File)
Sat, Oct 11, 12:03 AM
Unknown Object (File)
Fri, Oct 10, 5:37 PM
Unknown Object (File)
Mon, Oct 6, 10:57 PM
Unknown Object (File)
Thu, Oct 2, 10:34 PM
Unknown Object (File)
Wed, Oct 1, 4:50 AM
Unknown Object (File)
Sat, Sep 27, 10:35 PM
Subscribers

Details

Summary
PR:     288266
Reported by:    Robert Morris <rtm@lcs.mit.edu>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jul 17 2025, 1:14 AM

Might be it even makes sense to remount ro, but the damage is still there so probably not a big deal.
I do not think that we must filter out such entries, only return them into the safe territory.

Isn't this a more general problem? e.g. UFS also does not validate the returned directory entries.

sys/fs/msdosfs/msdosfs_conv.c
817

IMO it is a bit clearer if the substitution is done in dos2unixfn().

Isn't this a more general problem? e.g. UFS also does not validate the returned directory entries.

I do not think so. For UFS (and probably ZFS) it would be a different issue:

  • for UFS we trust on-disc format, and the issue like invalid dirent must be fixed by fsck.
  • for msdosfs, the volume content is more often cannot be relied upon, it is either comes from other OS, or is even dynamically generated. In modern times msdosfs volume is typically the systems communication and interoperability mechanism.

So we must be prepared for invalid msdosfs formats, while we consider UFS format errors as exceptions.

sys/fs/msdosfs/msdosfs_conv.c
817

There are several of them, and IMO it is not worth to spread the same fix over all places.

This revision is now accepted and ready to land.Jul 17 2025, 9:42 PM
This revision was automatically updated to reflect the committed changes.