netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Joanne Koong <joannekoong@fb.com>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
	<edumazet@google.com>, <kafai@fb.com>, <davem@davemloft.net>,
	<pabeni@redhat.com>, <testing@vger.kernel.org>,
	Joanne Koong <joannelkoong@gmail.com>,
	<syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com>,
	Eric Dumazet <edumzet@google.com>
Subject: Re: [PATCH net-next v1 resend 1/2] net: Update bhash2 when socket's rcv saddr changes
Date: Wed, 1 Jun 2022 18:13:04 -0700	[thread overview]
Message-ID: <20220601181304.6459d831@kernel.org> (raw)
In-Reply-To: <20220601201434.1710931-2-joannekoong@fb.com>

On Wed, 1 Jun 2022 13:14:33 -0700 Joanne Koong wrote:
> From: Joanne Koong <joannelkoong@gmail.com>
> 
> 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>

This one needs to be static:

net/ipv4/inet_hashtables.c:830:5: warning: no previous prototype for ‘__inet_bhash2_update_saddr’ [-Wmissing-prototypes]
  830 | int __inet_bhash2_update_saddr(struct sock *sk, struct inet_hashinfo *hinfo,

  parent reply	other threads:[~2022-06-02  1:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 20:14 [PATCH net-next v1 resend 0/2] Update bhash2 when socket's rcv saddr changes Joanne Koong
2022-06-01 20:14 ` [PATCH net-next v1 resend 1/2] net: " Joanne Koong
2022-06-02  1:09   ` kernel test robot
2022-06-02  1:13   ` Jakub Kicinski [this message]
2022-06-02  6:50   ` kernel test robot
2022-06-01 20:14 ` [PATCH net-next v1 resend 2/2] selftests/net: Add sk_bind_sendto_listen test 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=20220601181304.6459d831@kernel.org \
    --to=kuba@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumzet@google.com \
    --cc=joannekoong@fb.com \
    --cc=joannelkoong@gmail.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com \
    --cc=testing@vger.kernel.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 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).