Page MenuHomeFreeBSD

ufs: Avoid subobject overflow in snapshot expunge code
ClosedPublic

Authored by jrtc27 on Dec 24 2021, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 11:55 AM
Unknown Object (File)
Feb 8 2024, 9:37 PM
Unknown Object (File)
Jan 20 2024, 7:52 AM
Unknown Object (File)
Jan 12 2024, 3:05 PM
Unknown Object (File)
Dec 12 2023, 11:04 PM
Unknown Object (File)
Nov 10 2023, 9:43 AM
Unknown Object (File)
Oct 9 2023, 8:40 AM
Unknown Object (File)
Oct 6 2023, 11:27 PM
Subscribers

Details

Summary

The code here tries to be smart and zeroes out both di_db and di_ib with
a single bzero call, thereby overrunning the di_db subobject. This is
fine on most architectures, if a little dodgy. However, on CHERI, the
compiler can optionally restrict the bounds on pointers to subobjects to
just that subobject, in order to mitigate intra-object buffer overflows,
and this is enabled in CheriBSD's pure-capability kernels.

Instead, use separate bzero calls for each array, and let the compiler
optimise it as it sees fit; even if it's not generating inline zeroing
code, Clang will happily optimise two consecutive bzero's to a single
larger call.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43583
Build 40471: arc lint + arc unit