You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TCP Fast Open (TFO) is TCP protocol optimization method that allows the server to start sending data immediately after receiving the initial SYN packet from the client (1st step of the 3-way handshake).
There are two ways to initiate TFO connection in Linux (both related to TCP sockets):
Call sendmsg(2) with MSG_FASTOPEN flag. This performs an implicit connection by calling __inet_stream_connect() in tcp_sendmsg_fastopen().
This implicit connection cannot be controlled with connect(2) LSM hook, and it is not controlled by any LSM in the sendmsg(2) hook. Moreover, I haven't found if this case has been discussed before (for any LSM). Please, share if you know any.
Since Landlock has TCP-specific access control, I suppose the TFO case is not fully covered as it should be. If so, I suggest the following ways to provide related restriction:
Consider the connection with MSG_FASTOPEN as a bug, provide dedicated patch-fix.
Consider restriction of TFO as an improvement, fix documentation by pointing that TFO is not completely restricted and implement restriction with an another patchset.
First way may look better in terms of API simplicity.
Since TFO connection should be fast, implementation may (and probably will) require a performance evaluation (possibly with #24).
The text was updated successfully, but these errors were encountered:
Call sendmsg(2) with MSG_FASTOPEN flag. This performs an implicit connection by calling __inet_stream_connect() in tcp_sendmsg_fastopen().
Good catch!
This implicit connection cannot be controlled with connect(2) LSM hook, and it is not controlled by any LSM in the sendmsg(2) hook. Moreover, I haven't found if this case has been discussed before (for any LSM). Please, share if you know any.
Since Landlock has TCP-specific access control, I suppose the TFO case is not fully covered as it should be. If so, I suggest the following ways to provide related restriction:
Consider the connection with MSG_FASTOPEN as a bug, provide dedicated patch-fix.
The LANDLOCK_ACCESS_NET_CONNECT_TCP should cover the case with sendmsg(2) and MSG_FASTOPEN, otherwise it is indeed a bug.
Calling security_socket_connect() in tcp_sendmsg_fastopen() should fix it.
Consider restriction of TFO as an improvement, fix documentation by pointing that TFO is not completely restricted and implement restriction with an another patchset.
I'm not sure of what could be controlled. connect makes sense to developers, probably not fastopen.
TCP Fast Open (TFO) is TCP protocol optimization method that allows the server to start sending data immediately after receiving the initial SYN packet from the client (1st step of the 3-way handshake).
There are two ways to initiate TFO connection in Linux (both related to TCP sockets):
MSG_FASTOPEN
flag. This performs an implicit connection by calling__inet_stream_connect()
intcp_sendmsg_fastopen()
.This implicit connection cannot be controlled with
connect(2)
LSM hook, and it is not controlled by any LSM in thesendmsg(2)
hook. Moreover, I haven't found if this case has been discussed before (for any LSM). Please, share if you know any.Since Landlock has TCP-specific access control, I suppose the TFO case is not fully covered as it should be. If so, I suggest the following ways to provide related restriction:
MSG_FASTOPEN
as a bug, provide dedicated patch-fix.First way may look better in terms of API simplicity.
Since TFO connection should be fast, implementation may (and probably will) require a performance evaluation (possibly with #24).
The text was updated successfully, but these errors were encountered: