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
F95857767: D31536.diff
Sun, Sep 22, 8:18 PM
F95802612: D31536.diff
Sun, Sep 22, 5:21 PM
Unknown Object (File)
Fri, Sep 20, 10:52 PM
Unknown Object (File)
Thu, Sep 19, 5:52 AM
Unknown Object (File)
Wed, Sep 18, 6:27 AM
Unknown Object (File)
Wed, Sep 18, 4:52 AM
Unknown Object (File)
Wed, Sep 18, 12:24 AM
Unknown Object (File)
Tue, Sep 17, 6:11 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable