Page MenuHomeFreeBSD

netsmb: Add bounds checking to smb_t2_placedata
ClosedPublic

Authored by jhb on Jul 28 2023, 10:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 8, 8:37 AM
Unknown Object (File)
Nov 27 2025, 3:55 PM
Unknown Object (File)
Nov 26 2025, 10:05 AM
Unknown Object (File)
Nov 20 2025, 9:38 PM
Unknown Object (File)
Nov 20 2025, 9:37 PM
Unknown Object (File)
Nov 20 2025, 9:36 PM
Unknown Object (File)
Nov 20 2025, 9:28 PM
Unknown Object (File)
Nov 18 2025, 2:49 AM

Details

Summary

Verify that the requested region of the mbuf chain is not beyond the
end of the chain before trimming it from the end. If it is out of
bounds, fail with an error (EPROTO).

While here, properly handle the case that the amount of data at the
end of the chain might span more than one mbuf by using m_adj to drop
the extra bytes rather than assuming m_len of the last mbuf can be
adjusted directly.

PR: 258504
Reported by: Robert Morris <rtm@lcs.mit.edu>
Co-authored-by: Robert Morris <rtm@lcs.mit.edu>
Sponsored by: The FreeBSD Foundation

Diff Detail

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