From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <lmb@isovalent.com>
Cc: <bpf@vger.kernel.org>, <daniel@iogearbox.net>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<kuniyu@amazon.com>, <linux-kernel@vger.kernel.org>,
<martin.lau@kernel.org>, <martin.lau@linux.dev>,
<memxor@gmail.com>, <netdev@vger.kernel.org>, <pabeni@redhat.com>
Subject: Re: [PATCH bpf-next] net: Fix slab-out-of-bounds in inet[6]_steal_sock
Date: Wed, 9 Aug 2023 10:14:51 -0700 [thread overview]
Message-ID: <20230809171451.78725-1-kuniyu@amazon.com> (raw)
In-Reply-To: <CAN+4W8h44UdLRT+QLdh2rNeiKg0AkPAuGtYuXOgtFzvT2kHsWg@mail.gmail.com>
From: Lorenz Bauer <lmb@isovalent.com>
Date: Wed, 9 Aug 2023 17:55:02 +0100
> On Wed, Aug 9, 2023 at 4:56 PM Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
> >
> > > Things we could do if necessary:
> > > 1. Reset the flag in inet_csk_clone_lock like we do for SOCK_RCU_FREE
> >
> > I think we can't do this as sk_reuseport is inherited to twsk and used
> > in inet_bind_conflict().
>
> Ok, so what kind of state does reuseport carry in the various states then?
>
> TCP_LISTEN: sk_reuseport && sk_reuseport_cb
> TCP_ESTABLISHED: sk_reuseport && !sk_reuseport_cb
> TCP_TIME_WAIT: sk_reuseport && !sk_reuseport_cb
>
> Where is sk_reuseport_cb cleared? On clone? Or not at all?
sk_clone_lock() does when cloning sk from listener, and we
cannot check sk_reuseport_cb for twsk as it doesn't have the
member.
>
> > > 2. Duplicate the cb check into inet[6]_steal_sock
> >
> > or 3. Add sk_fullsock() test ?
>
> I guess this would be in addition to the convoluted series of checks
> I've removed in this patch?
Yes.
next prev parent reply other threads:[~2023-08-09 17:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 8:33 Lorenz Bauer
2023-08-09 11:58 ` Kumar Kartikeya Dwivedi
2023-08-09 14:39 ` Martin KaFai Lau
2023-08-09 15:08 ` Lorenz Bauer
2023-08-09 15:55 ` Kuniyuki Iwashima
2023-08-09 16:55 ` Lorenz Bauer
2023-08-09 17:14 ` Kuniyuki Iwashima [this message]
2023-08-09 17:12 ` Martin KaFai Lau
2023-08-12 3:35 ` Martin KaFai Lau
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=20230809171451.78725-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lmb@isovalent.com \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®