Message ID | 20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-v1-0-04d177057eb9@tessares.net (mailing list archive) |
---|---|
Headers | show |
Series | mptcp: refactor first subflow init | expand |
Hello: This series was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Fri, 14 Apr 2023 16:07:59 +0200 you wrote: > This series refactors the initialisation of the first subflow of a > listen socket. The first subflow allocation is no longer done at the > initialisation of the socket but later, when the connection request is > received or when requested by the userspace. > > This is needed not just because Paolo likes to refactor things but > because this simplifies the code and makes the behaviour more consistent > with the rest. Also, this is a prerequisite for future patches adding > proper support of SELinux/LSM labels with MPTCP and accept(2). > > [...] Here is the summary with links: - [net-next,1/5] mptcp: drop unneeded argument https://git.kernel.org/netdev/net-next/c/7a486c443c89 - [net-next,2/5] mptcp: avoid unneeded __mptcp_nmpc_socket() usage https://git.kernel.org/netdev/net-next/c/617612316953 - [net-next,3/5] mptcp: move fastopen subflow check inside mptcp_sendmsg_fastopen() https://git.kernel.org/netdev/net-next/c/a2702a076e73 - [net-next,4/5] mptcp: move first subflow allocation at mpc access time https://git.kernel.org/netdev/net-next/c/ddb1a072f858 - [net-next,5/5] mptcp: fastclose msk when cleaning unaccepted sockets https://git.kernel.org/netdev/net-next/c/8d547809a5d7 You are awesome, thank you!
This series refactors the initialisation of the first subflow of a listen socket. The first subflow allocation is no longer done at the initialisation of the socket but later, when the connection request is received or when requested by the userspace. This is needed not just because Paolo likes to refactor things but because this simplifies the code and makes the behaviour more consistent with the rest. Also, this is a prerequisite for future patches adding proper support of SELinux/LSM labels with MPTCP and accept(2). In [1], Ondrej Mosnacek explained they discovered the (userspace-facing) sockets returned by accept(2) when using MPTCP always end up with the label representing the kernel (typically system_u:system_r:kernel_t:s0), while it would make more sense to inherit the context from the parent socket (the one that is passed to accept(2)). Before being able to properly support that on SELinux/LSM side, patches 2-3/5 prepare the code to simplify the patch 4/5 moving the allocation. Patch 1/5 is a small clean-up seen while working on the series and patch 5/5 is a small improvement when closing unaccepted sockets. [1] https://lore.kernel.org/netdev/CAFqZXNs2LF-OoQBUiiSEyranJUXkPLcCfBkMkwFeM6qEwMKCTw@mail.gmail.com/ Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- Paolo Abeni (5): mptcp: drop unneeded argument mptcp: avoid unneeded __mptcp_nmpc_socket() usage mptcp: move fastopen subflow check inside mptcp_sendmsg_fastopen() mptcp: move first subflow allocation at mpc access time mptcp: fastclose msk when cleaning unaccepted sockets net/mptcp/options.c | 2 +- net/mptcp/pm.c | 4 +-- net/mptcp/pm_netlink.c | 4 +-- net/mptcp/protocol.c | 97 +++++++++++++++++++++++++++++++++----------------- net/mptcp/protocol.h | 4 +-- net/mptcp/sockopt.c | 24 +++++++------ net/mptcp/subflow.c | 2 +- 7 files changed, 86 insertions(+), 51 deletions(-) --- base-commit: e473ea818bfe42cbdf872c41593cbaf24dbf1297 change-id: 20230414-upstream-net-next-20230414-mptcp-refactor-first-subflow-init-ae4659df6ab9 Best regards,