[PATCH v3 mptcp-next 00/15] mptcp: refactor first subflow init

Paolo Abeni posted 15 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1674767058.git.pabeni@redhat.com
Maintainers: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, David Ahern <dsahern@kernel.org>, Matthieu Baerts <matthieu.baerts@tessares.net>, Paul Moore <paul@paul-moore.com>, James Morris <jmorris@namei.org>, "Serge E. Hallyn" <serge@hallyn.com>, Stephen Smalley <stephen.smalley.work@gmail.com>, Eric Paris <eparis@parisplace.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Benjamin Hesmans <benjamin.hesmans@tessares.net>, Geliang Tang <geliangtang@gmail.com>
include/linux/lsm_hook_defs.h |   1 +
include/linux/lsm_hooks.h     |   9 ++
include/linux/security.h      |   6 ++
include/net/inet_common.h     |   2 +
net/ipv4/af_inet.c            |  32 +++----
net/mptcp/options.c           |   9 +-
net/mptcp/pm.c                |   4 +-
net/mptcp/pm_netlink.c        |  14 +--
net/mptcp/protocol.c          | 158 +++++++++++++++++-----------------
net/mptcp/protocol.h          |   4 +-
net/mptcp/sockopt.c           |  31 ++++---
net/mptcp/subflow.c           |  57 +++++++-----
security/security.c           |   5 ++
security/selinux/hooks.c      |  16 ++++
security/selinux/netlabel.c   |   8 +-
15 files changed, 215 insertions(+), 141 deletions(-)
[PATCH v3 mptcp-next 00/15] mptcp: refactor first subflow init
Posted by Paolo Abeni 1 year, 2 months ago
This is the needed refactor for the selinux fixes, as discussed on
the ML.

Compared to v2 this revision introduces 2 additional patches:
1/15, just another cleanup found while addressing the recent bugs
12/15 factoring out a __inet_listener() helper, as suggested by Mat.

The only other patches with some change is 9/15, adding more
comments and consistently reporting the newly introduced error code
(a bit different from what discussed on the ML, for consistency's sake).

Paolo Abeni (15):
  mptcp: use mptcp_schedule_work() instead of open-codying it
  mptcp: fix locking for setsockopt corner-case
  mptcp: fix locking for in-kernel listener creation.
  mptcp: refactor passive socket initialization.
  mptcp: drop unneeded argument
  mptcp: drop legacy code.
  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: do not keep around the first subflow after disconnect.
  mptcp: fastclose msk when cleaning unaccepted sockets
  inet: factor out locked section of inet_accept() in a new helper
  mptcp: refactor mptcp_stream_accept()
  security, lsm: Introduce security_mptcp_add_subflow()
  selinux: Implement mptcp_add_subflow hook

 include/linux/lsm_hook_defs.h |   1 +
 include/linux/lsm_hooks.h     |   9 ++
 include/linux/security.h      |   6 ++
 include/net/inet_common.h     |   2 +
 net/ipv4/af_inet.c            |  32 +++----
 net/mptcp/options.c           |   9 +-
 net/mptcp/pm.c                |   4 +-
 net/mptcp/pm_netlink.c        |  14 +--
 net/mptcp/protocol.c          | 158 +++++++++++++++++-----------------
 net/mptcp/protocol.h          |   4 +-
 net/mptcp/sockopt.c           |  31 ++++---
 net/mptcp/subflow.c           |  57 +++++++-----
 security/security.c           |   5 ++
 security/selinux/hooks.c      |  16 ++++
 security/selinux/netlabel.c   |   8 +-
 15 files changed, 215 insertions(+), 141 deletions(-)

-- 
2.39.1
Re: [PATCH v3 mptcp-next 00/15] mptcp: refactor first subflow init
Posted by Matthieu Baerts 1 year, 2 months ago
Hi Paolo,

On 26/01/2023 22:05, Paolo Abeni wrote:
> This is the needed refactor for the selinux fixes, as discussed on
> the ML.

Thank you for the new version!

> Compared to v2 this revision introduces 2 additional patches:
> 1/15, just another cleanup found while addressing the recent bugs

I guess this patch 1/15 is for net-next, like the rest except patches
2-3/15 for -net and 14-15/15 for "features for other trees", OK with
that? :)

> 12/15 factoring out a __inet_listener() helper, as suggested by Mat.
> 
> The only other patches with some change is 9/15, adding more
> comments and consistently reporting the newly introduced error code
> (a bit different from what discussed on the ML, for consistency's sake).

That's fine for me!

I just have a small comment in patch 9/12 but I can do it when applying
the patch.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>

> Paolo Abeni (15):
>   mptcp: use mptcp_schedule_work() instead of open-codying it

(small detail: I'm not sure "open-codying" is correct, maybe "open coding"?)

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Re: [PATCH v3 mptcp-next 00/15] mptcp: refactor first subflow init
Posted by Matthieu Baerts 1 year, 2 months ago
Hi Paolo,

On 27/01/2023 15:04, Matthieu Baerts wrote:
> Hi Paolo,
> 
> On 26/01/2023 22:05, Paolo Abeni wrote:
>> This is the needed refactor for the selinux fixes, as discussed on
>> the ML.
> 
> Thank you for the new version!
> 
>> Compared to v2 this revision introduces 2 additional patches:
>> 1/15, just another cleanup found while addressing the recent bugs
> 
> I guess this patch 1/15 is for net-next, like the rest except patches
> 2-3/15 for -net and 14-15/15 for "features for other trees", OK with
> that? :)

I did the split as mentioned above:

New patches for t/upstream-net:
- 77065cb9b06b: mptcp: fix locking for setsockopt corner-case
- 25370fede8b4: mptcp: fix locking for in-kernel listener creation
- Results: 6b2c6f9b9f58..345e6b079d31 (export-net)
- Results: a9e99450a0dc..2cc9fbc57e9e (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net/20230130T104511

I did the modifications I mentioned before (open-coding, remove ret init
value + remove 'dot' at the end of commit titles)

New patches for t/upstream:
- 9e41e2ef1150: mptcp: use mptcp_schedule_work() instead of open-coding it
- 758223f115f3: mptcp: refactor passive socket initialization
- 679568236f20: mptcp: drop unneeded argument
- ccd4c33a46be: mptcp: drop legacy code
- 38bb4d9bf952: mptcp: avoid unneeded __mptcp_nmpc_socket() usage
- e89bb1c2776b: mptcp: move fastopen subflow check inside
mptcp_sendmsg_fastopen()
- ad01f840f0eb: mptcp: move first subflow allocation at mpc access time
- 12c5495dcbf4: conflict in t/mptcp-add-sched-in-mptcp_sock
- 3b92b0c170fd: mptcp: do not keep around the first subflow after disconnect
- ef7a57b6d68f: mptcp: fastclose msk when cleaning unaccepted sockets
- bce2ac546916: inet: factor out locked section of inet_accept() in a
new helper
- 7b01909e43c4: mptcp: refactor mptcp_stream_accept()
- Results: 2cc9fbc57e9e..9ce16c0a6116 (export)

And also the two last patches at the beginning of the "features for
other trees" section (without warnings reported by CheckPatch)

New patches for t/upstream:
- e10d02bc0bdd: security, lsm: Introduce security_mptcp_add_subflow()
- aaf4f8c54ca8: selinux: Implement mptcp_add_subflow hook
- Results: 9ce16c0a6116..638a12c9ada6 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230130T112422

I also just merge the modification in packetdrill:

https://github.com/multipath-tcp/packetdrill/pull/113

(and branched the 6.2 version)

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