Message ID | e8371ec8065e09317dcf7d7aabc6c54e63634bbb.1737222305.git.pabeni@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [mptcp-net] mptcp: handle fastopen disconnect correctly | expand |
Context | Check | Description |
---|---|---|
matttbe/build | success | Build and static analysis OK |
matttbe/checkpatch | warning | total: 0 errors, 1 warnings, 0 checks, 11 lines checked |
matttbe/shellcheck | success | MPTCP selftests files have not been modified |
matttbe/KVM_Validation__normal | success | Success! ✅ |
matttbe/KVM_Validation__debug | success | Success! ✅ |
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ | success | Success! ✅ |
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ | success | Success! ✅ |
Hi Paolo, Thank you for your modifications, that's great! Our CI did some validations and here is its report: - KVM Validation: normal: Success! ✅ - KVM Validation: debug: Success! ✅ - KVM Validation: btf-normal (only bpftest_all): Success! ✅ - KVM Validation: btf-debug (only bpftest_all): Success! ✅ - Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/12846236981 Initiator: Patchew Applier Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/de1825fac5c2 Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=926678 If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.: $ cd [kernel source code] $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \ --pull always mptcp/mptcp-upstream-virtme-docker:latest \ auto-normal For more details: https://github.com/multipath-tcp/mptcp-upstream-virtme-docker Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-) Cheers, MPTCP GH Action bot Bot operated by Matthieu Baerts (NGI0 Core)
Hi Paolo, On 18/01/2025 18:46, Paolo Abeni wrote: > Syzbot was able to trigger a data stream corruption: (...) > The root cause is the bad handling of disconnect() generated > internally by the MPTCP protocol in case of connect FASTOPEN > errors. > > Address the issue increasing the socket disconnect counter even > on such a case, to allow other threads waiting on the same socket > lock to properly error out. Thank you for having looked and fixed this! > Reported-by: syzbot+ebc0b8ae5d3590b2c074@syzkaller.appspotmail.com > Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/537 > Fixes: c2b2ae3925b6 ("mptcp: handle correctly disconnect() failures") > Tested-by: syzbot+ebc0b8ae5d3590b2c074@syzkaller.appspotmail.com > Signed-off-by: Paolo Abeni <pabeni@redhat.com> > --- > net/mptcp/protocol.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > index 1b2e7cbb577f..f910e840aa8f 100644 > --- a/net/mptcp/protocol.c > +++ b/net/mptcp/protocol.c > @@ -1767,8 +1767,10 @@ static int mptcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, > * see mptcp_disconnect(). > * Attempt it again outside the problematic scope. > */ > - if (!mptcp_disconnect(sk, 0)) > + if (!mptcp_disconnect(sk, 0)) { > + sk->sk_disconnects++; I guess it makes sense to have something similar to what is done in: net/ipv4/af_inet.c:__inet_stream_connect() Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > sk->sk_socket->state = SS_UNCONNECTED; > + } > } > inet_clear_bit(DEFER_CONNECT, sk); > Cheers, Matt
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1b2e7cbb577f..f910e840aa8f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1767,8 +1767,10 @@ static int mptcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, * see mptcp_disconnect(). * Attempt it again outside the problematic scope. */ - if (!mptcp_disconnect(sk, 0)) + if (!mptcp_disconnect(sk, 0)) { + sk->sk_disconnects++; sk->sk_socket->state = SS_UNCONNECTED; + } } inet_clear_bit(DEFER_CONNECT, sk);