Page MenuHomeFreeBSD

cd9660: Reject volumes with small logical block sizes
ClosedPublic

Authored by jhb on Jul 28 2023, 10:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 1:48 PM
Unknown Object (File)
Sat, Oct 26, 10:07 PM
Unknown Object (File)
Oct 1 2024, 9:57 PM
Unknown Object (File)
Sep 28 2024, 9:15 PM
Unknown Object (File)
Sep 28 2024, 9:33 AM
Unknown Object (File)
Sep 27 2024, 11:46 PM
Unknown Object (File)
Sep 27 2024, 3:27 PM
Unknown Object (File)
Sep 27 2024, 11:01 AM
Subscribers

Details

Summary

ISO9660 permits specifying a logical block size that is any power of 2
greater than or equal to 512. The geom disk layer requires requests
to be aligned on sector boundaries of the provider. With a volume
that uses a logical block size smaller than the underlying disk sector
size (e.g. a logical block size of 512 or 1025 on a CD which uses 2048
byte sectors), the current cd9660 vfs can issue requests for partial
sectors, or on non-sector boundaries.

Fixing this properly would require wrapping all of the calls to
bread*/bwrite* in cd9660 vfs to roundup requests to be on sector
boundaries which can include both the length, but also the starting
sector number (and thus requiring use of an offset relative to b_data
in the resulting buf).

These images do not seem to be common however given that no one has
fixed this in cd9660's vfs in the past few decades, so just reject
them during mount with an error. If such images are found to be used
in the wild in practice, then the larger fix can be applied.

PR: 258063
Reported by: Robert Morris <rtm@lcs.mit.edu>
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 52887
Build 49778: arc lint + arc unit