[PATCH net-next 0/5] mptcp: refactor first subflow init

Matthieu Baerts posted 5 patches 1 year ago
Failed in applying to current master (apply log)
There is a newer version of this series
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(-)
[PATCH net-next 0/5] mptcp: refactor first subflow init
Posted by Matthieu Baerts 1 year ago
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,
-- 
Matthieu Baerts <matthieu.baerts@tessares.net>
Re: [PATCH net-next 0/5] mptcp: refactor first subflow init
Posted by patchwork-bot+netdevbpf@kernel.org 1 year ago
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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net-next 0/5] mptcp: refactor first subflow init
Posted by Matthieu Baerts 1 year ago
Hi Paolo,

(- netdev ML and maintainers)

On 17/04/2023 09:20, patchwork-bot+netdevbpf@kernel.org wrote:
> 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

Now that these patches have been applied in net-next, do you want to ask
Paul Moore what to do with the two other patches modifying SELinux/LSM code?

I guess we are not in a hurry but I was thinking that it might even be
easier for Paul to maintain patches modifying MPTCP code now that we are
one or two weeks before the merge window: what could be done is to have
these patches sent to Linus during the second week of the merge window,
after the merge of net-next into Linus tree, possibly as part as a
second batch from Paul. Just a suggestion :)

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net