mbox series

[net,v2,0/8] mptcp: fixes for 6.3

Message ID 20230227-upstream-net-20230227-mptcp-fixes-v2-0-47c2e95eada9@tessares.net (mailing list archive)
Headers show
Series mptcp: fixes for 6.3 | expand

Message

Matthieu Baerts March 9, 2023, 2:49 p.m. UTC
Patch 1 fixes a possible deadlock in subflow_error_report() reported by
lockdep. The report was in fact a false positive but the modification
makes sense and silences lockdep to allow syzkaller to find real issues.
The regression has been introduced in v5.12.

Patch 2 is a refactoring needed to be able to fix the two next issues.
It improves the situation and can be backported up to v6.0.

Patches 3 and 4 fix UaF reported by KASAN. It fixes issues potentially
visible since v5.7 and v5.19 but only reproducible until recently
(v6.0). These two patches depend on patch 2/7.

Patch 5 fixes the order of the printed values: expected vs seen values.
The regression has been introduced recently: v6.3-rc1.

Patch 6 adds missing ro_after_init flags. A previous patch added them
for other functions but these two have been missed. This previous patch
has been backported to stable versions (up to v5.12) so probably better
to do the same here.

Patch 7 fixes tcp_set_state() being called twice in a row since v5.10.

Patch 8 fixes another lockdep false positive issue but this time in
MPTCP PM code. Same here, some modifications in the code has been made
to silence this issue and help finding real ones later. This issue can
be seen since v6.2.

Note that checkpatch.pl is now complaining about the "Closes" tag but
discussions are ongoing to add an exception:

  https://lore.kernel.org/all/a27480c5-c3d4-b302-285e-323df0349b8f@tessares.net/

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
Changes in v2:
- Patches 3 and 4 have been modified to fix the issue reported on netdev
- Patch 8 has been added
- Rebased
- Link to v1: https://lore.kernel.org/r/20230227-upstream-net-20230227-mptcp-fixes-v1-0-070e30ae4a8e@tessares.net

---
Geliang Tang (1):
      mptcp: add ro_after_init for tcp{,v6}_prot_override

Matthieu Baerts (2):
      selftests: mptcp: userspace pm: fix printed values
      mptcp: avoid setting TCP_CLOSE state twice

Paolo Abeni (5):
      mptcp: fix possible deadlock in subflow_error_report
      mptcp: refactor passive socket initialization
      mptcp: use the workqueue to destroy unaccepted sockets
      mptcp: fix UaF in listener shutdown
      mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()

 net/mptcp/pm_netlink.c                            |  16 +++
 net/mptcp/protocol.c                              |  64 +++++------
 net/mptcp/protocol.h                              |   6 +-
 net/mptcp/subflow.c                               | 128 +++++++---------------
 tools/testing/selftests/net/mptcp/userspace_pm.sh |   2 +-
 5 files changed, 95 insertions(+), 121 deletions(-)
---
base-commit: 67eeadf2f95326f6344adacb70c880bf2ccff57b
change-id: 20230227-upstream-net-20230227-mptcp-fixes-cc78f3a2f5b2

Best regards,

Comments

Jakub Kicinski March 11, 2023, 5:42 a.m. UTC | #1
On Thu, 09 Mar 2023 15:49:56 +0100 Matthieu Baerts wrote:
> Note that checkpatch.pl is now complaining about the "Closes" tag but
> discussions are ongoing to add an exception:
> 
>   https://lore.kernel.org/all/a27480c5-c3d4-b302-285e-323df0349b8f@tessares.net/

I've also complained about that series. One day we'll be a grown up
project where foundational tools are properly maintained and changes
to them reviewed. One day...
patchwork-bot+netdevbpf@kernel.org March 11, 2023, 5:50 a.m. UTC | #2
Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 09 Mar 2023 15:49:56 +0100 you wrote:
> Patch 1 fixes a possible deadlock in subflow_error_report() reported by
> lockdep. The report was in fact a false positive but the modification
> makes sense and silences lockdep to allow syzkaller to find real issues.
> The regression has been introduced in v5.12.
> 
> Patch 2 is a refactoring needed to be able to fix the two next issues.
> It improves the situation and can be backported up to v6.0.
> 
> [...]

Here is the summary with links:
  - [net,v2,1/8] mptcp: fix possible deadlock in subflow_error_report
    https://git.kernel.org/netdev/net/c/b7a679ba7c65
  - [net,v2,2/8] mptcp: refactor passive socket initialization
    https://git.kernel.org/netdev/net/c/3a236aef280e
  - [net,v2,3/8] mptcp: use the workqueue to destroy unaccepted sockets
    https://git.kernel.org/netdev/net/c/b6985b9b8295
  - [net,v2,4/8] mptcp: fix UaF in listener shutdown
    https://git.kernel.org/netdev/net/c/0a3f4f1f9c27
  - [net,v2,5/8] selftests: mptcp: userspace pm: fix printed values
    https://git.kernel.org/netdev/net/c/840742b7ed0e
  - [net,v2,6/8] mptcp: add ro_after_init for tcp{,v6}_prot_override
    https://git.kernel.org/netdev/net/c/822467a48e93
  - [net,v2,7/8] mptcp: avoid setting TCP_CLOSE state twice
    https://git.kernel.org/netdev/net/c/3ba14528684f
  - [net,v2,8/8] mptcp: fix lockdep false positive in mptcp_pm_nl_create_listen_socket()
    https://git.kernel.org/netdev/net/c/cee4034a3db1

You are awesome, thank you!