Page MenuHomeFreeBSD

so_splice: Disallow splicing with KTLS-enabled sockets
ClosedPublic

Authored by markj on Apr 19 2025, 10:35 PM.
Tags
None
Referenced Files
F157175081: D49920.id153945.diff
Tue, May 19, 1:14 AM
F157175027: D49920.id154096.diff
Tue, May 19, 1:14 AM
F157174736: D49920.diff
Tue, May 19, 1:11 AM
Unknown Object (File)
Sun, May 17, 12:51 AM
Unknown Object (File)
Fri, May 8, 8:11 AM
Unknown Object (File)
Tue, May 5, 9:17 AM
Unknown Object (File)
Sun, May 3, 3:23 PM
Unknown Object (File)
Sun, May 3, 11:50 AM
Subscribers

Details

Summary

Suppose the sink socket in a splice has KTLS enabled. When data is
transmitted from the source socket, sosend_generic_locked() receives an
mbuf rather than a UIO as it would if userspace were transferring data.
In this case, ktls_frame() expects the mbuf to be unmapped, but in
general this won't be the case.

Simply disallow the combination for now. Modify so_unsplice() to handle
dismantling a partially initialized splice, in order to simplify error
handling in so_splice(). Make sure that one can't enable KTLS on a
spliced socket, or more specifically, that one can't enable RXTLS on the
source side of a splice, or TXTLS on the sink side of a splice.

Reported by: syzbot+9cc248c4b0ca9b931ab4@syzkaller.appspotmail.com

Diff Detail

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