[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4e63f00-ab23-9926-b943-531caa1ae9ac@linux.intel.com>
Date: Tue, 25 Oct 2022 15:53:10 -0700 (PDT)
From: Mat Martineau <mathew.j.martineau@...ux.intel.com>
To: Eric Dumazet <edumazet@...gle.com>
cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
eric.dumazet@...il.com, syzbot <syzkaller@...glegroups.com>,
Matthieu Baerts <matthieu.baerts@...sares.net>,
Kuniyuki Iwashima <kuniyu@...zon.com>
Subject: Re: [PATCH net-next] mptcp: fix tracking issue in
mptcp_subflow_create_socket()
On Tue, 25 Oct 2022, Eric Dumazet 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 <syzkaller@...glegroups.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> Cc: Matthieu Baerts <matthieu.baerts@...sares.net>
> Cc: Kuniyuki Iwashima <kuniyu@...zon.com>
> ---
Hi Eric -
I also missed this quirk in MPTCP subflow handling, thanks for the fix:
Reviewed-by: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> net/mptcp/subflow.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index 07dd23d0fe04ac37f4cc66c0c21d4d41f50fb3f4..120f792fda9764271f020771b36d27c6e44d8618 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -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);
> --
> 2.38.0.135.g90850a2211-goog
>
>
--
Mat Martineau
Intel
Powered by blists - more mailing lists