Page MenuHomeFreeBSD

ktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers
ClosedPublic

Authored by markj on Sep 15 2021, 7:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 20 2024, 5:18 AM
Unknown Object (File)
Dec 23 2023, 12:08 AM
Unknown Object (File)
Dec 12 2023, 3:03 AM
Unknown Object (File)
Dec 1 2023, 6:24 AM
Unknown Object (File)
Dec 1 2023, 6:24 AM
Unknown Object (File)
Dec 1 2023, 6:24 AM
Unknown Object (File)
Dec 1 2023, 6:08 AM
Unknown Object (File)
Nov 18 2023, 2:18 AM
Subscribers

Details

Summary

ktls_get_(rx|tx)_mode() can return an errno value or a TLS mode, so
errors are effectively hidden. Fix this. Convert to the new socket
buffer locking macros while here.

Note that the socket buffer lock is not needed to synchronize the
SOLISTENING check here, we can rely on the PCB lock, acquired in
tcp_usr_listen().

Diff Detail

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

Event Timeline

markj requested review of this revision.Sep 15 2021, 7:59 PM

I think this is fine, just one thought.

sys/netinet/tcp_usrreq.c
2566

Did you consider doing the SOLISTENING check here instead of in the ktls_get_*_mode() routines?

sys/netinet/tcp_usrreq.c
2566

Hmm, not really. I noticed that other ktls_* routines check for listening sockets and the TCP socket option (wow there's a lot of them...) handlers generally do not, so it made sense to me to keep things consistent.

sys/netinet/tcp_usrreq.c
2566

Ok. Either way is fine with me.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 17 2021, 7:13 PM
This revision was automatically updated to reflect the committed changes.