netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] Update bhash2 when socket's rcv saddr changes
@ 2022-06-02 16:50 Joanne Koong
  2022-06-02 16:51 ` [PATCH net-next v2 1/2] net: " Joanne Koong
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Joanne Koong @ 2022-06-02 16:50 UTC (permalink / raw)
  To: netdev; +Cc: edumazet, kafai, kuba, davem, pabeni, Joanne Koong

As syzbot noted [1], there is an inconsistency in the bhash2 table in the
case where a socket's rcv saddr changes after it is binded. (For more
details, please see the commit message of the first patch)

This patchset fixes that and adds a test that triggers the case where the
sk's rcv saddr changes. The subsequent listen() call should succeed.

[1] https://lore.kernel.org/netdev/0000000000003f33bc05dfaf44fe@google.com/

--
v1 -> v2:
v1: https://lore.kernel.org/netdev/20220601201434.1710931-1-joannekoong@fb.com/
* Mark __inet_bhash2_update_saddr as static

Joanne Koong (2):
  net: Update bhash2 when socket's rcv saddr changes
  selftests/net: Add sk_bind_sendto_listen test

 include/net/inet_hashtables.h                 |  6 +-
 include/net/ipv6.h                            |  2 +-
 net/dccp/ipv4.c                               | 10 ++-
 net/dccp/ipv6.c                               |  4 +-
 net/ipv4/af_inet.c                            |  7 +-
 net/ipv4/inet_hashtables.c                    | 70 ++++++++++++++--
 net/ipv4/tcp_ipv4.c                           |  8 +-
 net/ipv6/inet6_hashtables.c                   |  4 +-
 net/ipv6/tcp_ipv6.c                           |  4 +-
 tools/testing/selftests/net/.gitignore        |  1 +
 tools/testing/selftests/net/Makefile          |  1 +
 .../selftests/net/sk_bind_sendto_listen.c     | 82 +++++++++++++++++++
 12 files changed, 181 insertions(+), 18 deletions(-)
 create mode 100644 tools/testing/selftests/net/sk_bind_sendto_listen.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-06-10 20:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 16:50 [PATCH net-next v2 0/2] Update bhash2 when socket's rcv saddr changes Joanne Koong
2022-06-02 16:51 ` [PATCH net-next v2 1/2] net: " Joanne Koong
2022-06-07  8:33   ` Paolo Abeni
2022-06-07 17:10     ` Mat Martineau
2022-06-07 20:24     ` Joanne Koong
2022-06-08  7:35       ` Paolo Abeni
2022-06-08 17:47         ` Joanne Koong
2022-06-02 16:51 ` [PATCH net-next v2 2/2] selftests/net: Add sk_bind_sendto_listen test Joanne Koong
2022-06-03 18:54 ` [PATCH net-next v2 0/2] Update bhash2 when socket's rcv saddr changes Mat Martineau
2022-06-04  0:38   ` Joanne Koong
2022-06-07  0:02     ` Joanne Koong
2022-06-07 17:31       ` Mat Martineau
2022-06-08 20:27         ` Joanne Koong
2022-06-09 23:52           ` Joanne Koong
2022-06-10  0:37             ` Mat Martineau
2022-06-10 18:09               ` Joanne Koong
2022-06-10 20:15                 ` Mat Martineau
2022-06-09 23:59           ` Mat Martineau

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).