Page MenuHomeFreeBSD

ktls: Fix accounting for TLS 1.0 empty fragments.
ClosedPublic

Authored by jhb on Aug 13 2021, 11:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 20, 4:21 AM
Unknown Object (File)
Tue, May 19, 1:17 AM
Unknown Object (File)
Tue, May 19, 1:16 AM
Unknown Object (File)
Tue, May 19, 1:14 AM
Unknown Object (File)
Apr 20 2026, 4:55 AM
Unknown Object (File)
Apr 14 2026, 10:04 PM
Unknown Object (File)
Apr 11 2026, 8:15 AM
Unknown Object (File)
Apr 11 2026, 12:40 AM
Subscribers

Details

Summary

TLS 1.0 empty fragment mbufs have no payload and thus m_epg_npgs is
zero. However, these mbufs need to occupy a "unit" of space for the
purposes of M_NOTREADY tracking similar to regular mbufs. Previously
this was done for the page count returned from ktls_frame() and passed
to ktls_enqueue() as well as the page count passed to pru_ready().

However, sbready() and mb_free_notready() only use m_epg_nrdy to
determine the number of "units" of space in an M_EXT mbuf, so when a
TLS 1.0 fragment was marked ready it would mark one unit of the next
mbuf in the socket buffer as ready as well. To fix, set m_epg_nrdy to
1 for empty fragments. This actually simplifies the code as now only
ktls_frame() has to handle TLS 1.0 fragments explicitly and the rest
of the KTLS functions can just use m_epg_nrdy.

Diff Detail

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