mptcp: fix tracking issue in mptcp_subflow_create_socket()
Subsystems (3)
PATCH 1/1 mptcp: fix tracking issue in mptcp_subflow_create_socket()
My recent patch missed that mptcp_subflow_create_socket() was creating a 'kernel' socket, then converted it to 'user' socket.
--- net/mptcp/subflow.c | 2 ++ 1 file changed, 2 insertions(+)
net/mptcp/subflow.c +2 -0
@@ -1595,7 +1595,9 @@ int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock)/* kernel sockets do not by default acquire net ref, but TCP timer * needs it. +* Update ns_tracker to current stack trace and refcounted tracker. */ +__netns_tracker_free (net, &sf->sk->ns_tracker, false); sf->sk->sk_net_refcnt =1 ;get_net_track (net, &sf->sk->ns_tracker,GFP_KERNEL );sock_inuse_add (net,1 );
Signature · 1 line
2.38.0.135.g90850a2211-goog
From: Eric Dumazet <[email protected]> Date: Tue, 25 Oct 2022 18:05:46 +0000
Quoted 6 lines
My recent patch missed that
mptcp_subflow_create_socket()was creating a 'kernel' socket, then converted it to 'user' socket.Fixes 0cafd77dcd03 ("net: add a refcount tracker for kernel sockets")Reported-by syzbot <[email protected]>Signed-off-by Eric Dumazet <[email protected]>
I missed that, thanks for the fix!
Quoted 23 lines
Cc Mat Martineau <[email protected]>Cc Matthieu Baerts <[email protected]>Cc Kuniyuki Iwashima <[email protected]>--- net/mptcp/subflow.c | 2 ++ 1 file changed, 2 insertions(+)net/mptcp/subflow.c +2
-0@@ -1595,7 +1595,9 @@ int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock)/* kernel sockets do not by default acquire net ref, but TCP timer * needs it. +* Update ns_tracker to current stack trace and refcounted tracker. */ +__netns_tracker_free (net, &sf->sk->ns_tracker, false); sf->sk->sk_net_refcnt =1 ;get_net_track (net, &sf->sk->ns_tracker,GFP_KERNEL );sock_inuse_add (net,1 );Signature · 1 line
2.38.0.135.g90850a2211-goog
Quoted 10 lines · Eric Dumazet
My recent patch missed that
mptcp_subflow_create_socket()was creating a 'kernel' socket, then converted it to 'user' socket.Fixes 0cafd77dcd03 ("net: add a refcount tracker for kernel sockets")Reported-by syzbot <[email protected]>Signed-off-by Eric Dumazet <[email protected]>Cc Mat Martineau <[email protected]>Cc Matthieu Baerts <[email protected]>Cc Kuniyuki Iwashima <[email protected]>---
Hi Eric -
I also missed this quirk in MPTCP subflow handling, thanks for the fix:
Quoted 21 lines
net/mptcp/subflow.c| 2 ++1 file changed, 2 insertions(+)net/mptcp/subflow.c +2
-0@@ -1595,7 +1595,9 @@ int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock)/* kernel sockets do not by default acquire net ref, but TCP timer * needs it. +* Update ns_tracker to current stack trace and refcounted tracker. */ +__netns_tracker_free (net, &sf->sk->ns_tracker, false); sf->sk->sk_net_refcnt =1 ;get_net_track (net, &sf->sk->ns_tracker,GFP_KERNEL );sock_inuse_add (net,1 );Signature · 1 line
2.38.0.135.g90850a2211-goog
--
Mat Martineau
Intel
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Tue, 25 Oct 2022 18:05:46 +0000 you wrote:
My recent patch missed that
mptcp_subflow_create_socket()was creating a 'kernel' socket, then converted it to 'user' socket.Fixes 0cafd77dcd03 ("net: add a refcount tracker for kernel sockets")Reported-by syzbot <[email protected]>Signed-off-by Eric Dumazet <[email protected]>Cc Mat Martineau <[email protected]>Cc Matthieu Baerts <[email protected]>Cc Kuniyuki Iwashima <[email protected]>[...]
Here is the summary with links:
- [net-next] mptcp: fix tracking issue in mptcp_subflow_create_socket()
https://git.kernel.org/netdev/net-next/c/d1e96cc4fbe0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html