This is a note to let you know that I've just added the patch titled mptcp: fix NULL pointer dereference on fastopen early fallback to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mptcp-fix-null-pointer-dereference-on-fastopen-early-fallback.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c0ff6f6da66a7791a32c0234388b1bdc00244917 Mon Sep 17 00:00:00 2001 From: Paolo Abeni <pabeni@xxxxxxxxxx> Date: Tue, 11 Apr 2023 22:42:11 +0200 Subject: mptcp: fix NULL pointer dereference on fastopen early fallback From: Paolo Abeni <pabeni@xxxxxxxxxx> commit c0ff6f6da66a7791a32c0234388b1bdc00244917 upstream. In case of early fallback to TCP, subflow_syn_recv_sock() deletes the subflow context before returning the newly allocated sock to the caller. The fastopen path does not cope with the above unconditionally dereferencing the subflow context. Fixes: 36b122baf6a8 ("mptcp: add subflow_v(4,6)_send_synack()") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx> Reviewed-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/mptcp/fastopen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/net/mptcp/fastopen.c +++ b/net/mptcp/fastopen.c @@ -9,11 +9,18 @@ void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subflow, struct request_sock *req) { - struct sock *ssk = subflow->tcp_sock; - struct sock *sk = subflow->conn; + struct sock *sk, *ssk; struct sk_buff *skb; struct tcp_sock *tp; + /* on early fallback the subflow context is deleted by + * subflow_syn_recv_sock() + */ + if (!subflow) + return; + + ssk = subflow->tcp_sock; + sk = subflow->conn; tp = tcp_sk(ssk); subflow->is_mptfo = 1; Patches currently in stable-queue which might be from pabeni@xxxxxxxxxx are queue-6.2/mptcp-stricter-state-check-in-mptcp_worker.patch queue-6.2/mptcp-use-mptcp_schedule_work-instead-of-open-coding-it.patch queue-6.2/net-phy-nxp-c45-tja11xx-add-remove-callback.patch queue-6.2/mptcp-fix-null-pointer-dereference-on-fastopen-early-fallback.patch queue-6.2/sctp-fix-a-potential-overflow-in-sctp_ifwdtsn_skip.patch queue-6.2/selftests-mptcp-userspace-pm-uniform-verify-events.patch queue-6.2/net-qrtr-fix-an-uninit-variable-access-bug-in-qrtr_t.patch