From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <edumazet@google.com>
Cc: <davem@davemloft.net>, <ebiggers@google.com>,
<eric.dumazet@gmail.com>, <kuba@kernel.org>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<syzbot+32b89eaa102b372ff76d@syzkaller.appspotmail.com>
Subject: Re: [PATCH net] llc: call sock_orphan() at release time
Date: Sun, 28 Jan 2024 00:13:33 -0800 [thread overview]
Message-ID: <20240128081333.2392-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20240126165532.3396702-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Fri, 26 Jan 2024 16:55:32 +0000
> syzbot reported an interesting trace [1] caused by a stale sk->sk_wq
> pointer in a closed llc socket.
>
> In commit ff7b11aa481f ("net: socket: set sock->sk to NULL after
> calling proto_ops::release()") Eric Biggers hinted that some protocols
> are missing a sock_orphan(), we need to perform a full audit.
>
> In net-next, I plan to clear sock->sk from sock_orphan() and
> amend Eric patch to add a warning.
[...]
>
> Fixes: 43815482370c ("net: sock_def_readable() and friends RCU conversion")
> Reported-and-tested-by: syzbot+32b89eaa102b372ff76d@syzkaller.appspotmail.com
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Eric Biggers <ebiggers@google.com>
> Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
The plan sounds good to me, thanks!
> ---
> net/llc/af_llc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
> index 20551cfb7da6d8dd098c906477895e26c080fe32..fde1140d899efc7ba02e6bc3998cb857ef30df14 100644
> --- a/net/llc/af_llc.c
> +++ b/net/llc/af_llc.c
> @@ -226,6 +226,8 @@ static int llc_ui_release(struct socket *sock)
> }
> netdev_put(llc->dev, &llc->dev_tracker);
> sock_put(sk);
> + sock_orphan(sk);
> + sock->sk = NULL;
> llc_sk_free(sk);
> out:
> return 0;
> --
> 2.43.0.429.g432eaa2c6b-goog
next prev parent reply other threads:[~2024-01-28 8:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 16:55 [PATCH net] llc: call sock_orphan() at release time Eric Dumazet
2024-01-28 8:13 ` Kuniyuki Iwashima [this message]
2024-01-30 13:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240128081333.2392-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=ebiggers@google.com \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+32b89eaa102b372ff76d@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).