All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: netdev@vger.kernel.org, kafai@fb.com, kuba@kernel.org,
	davem@davemloft.net, richard_siegfried@systemli.org,
	dsahern@kernel.org, pabeni@redhat.com, yoshfuji@linux-ipv6.org,
	kuniyu@amazon.co.jp, dccp@vger.kernel.org,
	testing@vger.kernel.org,
	syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com
Subject: Re: [PATCH net-next v1 1/2] net: Update bhash2 when socket's rcv saddr changes
Date: Tue, 31 May 2022 15:04:34 -0700	[thread overview]
Message-ID: <CANn89i+pg8guF+XeOngSMa4vUD81g=u-pCBpi0Yp2WB9PQZvdg@mail.gmail.com> (raw)
In-Reply-To: <20220524230400.1509219-2-joannelkoong@gmail.com>

On Tue, May 24, 2022 at 4:20 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> Commit d5a42de8bdbe ("net: Add a second bind table hashed by port and
> address") added a second bind table, bhash2, that hashes by a socket's port
> and rcv address.
>
> However, there are two cases where the socket's rcv saddr can change
> after it has been binded:
>
> 1) The case where there is a bind() call on "::" (IPADDR_ANY) and then
> a connect() call. The kernel will assign the socket an address when it
> handles the connect()
>
> 2) In inet_sk_reselect_saddr(), which is called when rerouting fails
> when rebuilding the sk header (invoked by inet_sk_rebuild_header)
>
> In these two cases, we need to update the bhash2 table by removing the
> entry for the old address, and adding a new entry reflecting the updated
> address.
>
> Reported-by: syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com
> Fixes: d5a42de8bdbe ("net: Add a second bind table hashed by port and address")
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---

Reviewed-by: Eric Dumazet <edumzet@google.com>

WARNING: multiple messages have this Message-ID (diff)
From: Eric Dumazet <edumazet@google.com>
To: dccp@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/2] net: Update bhash2 when socket's rcv saddr changes
Date: Tue, 31 May 2022 22:04:34 +0000	[thread overview]
Message-ID: <CANn89i+pg8guF+XeOngSMa4vUD81g=u-pCBpi0Yp2WB9PQZvdg@mail.gmail.com> (raw)

On Tue, May 24, 2022 at 4:20 PM Joanne Koong <joannelkoong@gmail.com> wrote:
>
> Commit d5a42de8bdbe ("net: Add a second bind table hashed by port and
> address") added a second bind table, bhash2, that hashes by a socket's port
> and rcv address.
>
> However, there are two cases where the socket's rcv saddr can change
> after it has been binded:
>
> 1) The case where there is a bind() call on "::" (IPADDR_ANY) and then
> a connect() call. The kernel will assign the socket an address when it
> handles the connect()
>
> 2) In inet_sk_reselect_saddr(), which is called when rerouting fails
> when rebuilding the sk header (invoked by inet_sk_rebuild_header)
>
> In these two cases, we need to update the bhash2 table by removing the
> entry for the old address, and adding a new entry reflecting the updated
> address.
>
> Reported-by: syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com
> Fixes: d5a42de8bdbe ("net: Add a second bind table hashed by port and address")
> Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
> ---

Reviewed-by: Eric Dumazet <edumzet@google.com>

       reply	other threads:[~2022-05-31 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220524230400.1509219-1-joannelkoong@gmail.com>
     [not found] ` <20220524230400.1509219-2-joannelkoong@gmail.com>
2022-05-31 22:04   ` Eric Dumazet [this message]
2022-05-31 22:04     ` [PATCH net-next v1 1/2] net: Update bhash2 when socket's rcv saddr changes Eric Dumazet
2022-06-01  9:58     ` Paolo Abeni
2022-06-01  9:58       ` Paolo Abeni
2022-06-01 18:31       ` Joanne Koong
2022-06-01 18:31         ` Joanne Koong

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='CANn89i+pg8guF+XeOngSMa4vUD81g=u-pCBpi0Yp2WB9PQZvdg@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=dccp@vger.kernel.org \
    --cc=dsahern@kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=kafai@fb.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.co.jp \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richard_siegfried@systemli.org \
    --cc=syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com \
    --cc=testing@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.