From: Stas Sergeev
Date: Sat, 16 Nov 2024 13:11:20 +0300
> Currently SCM_PIDFD cmsg cannot be sent via unix socket
> (returns -EINVAL) and SO_PASSPIDFD doesn't support flags.
> The created pidfd always has flags set to 0.
>
> This patch implements SCM_PIDFD cmsg in AF_UNIX socket, which
> can be
b
> where it was suggested to try solving the supplementary groups
> problem with pidfd.
>
> Changes in v2: remove flags validation in scm_pidfd_recv(), as
> suggested by Kuniyuki Iwashima
You can put this changelog and the following CC: under '---' so
that they will
From: Stas Sergeev
Date: Thu, 14 Nov 2024 00:02:05 +0300
> @@ -154,7 +157,12 @@ static __inline__ void scm_pidfd_recv(struct msghdr
> *msg, struct scm_cookie *scm
> if (!scm->pid)
> return;
>
> - pidfd = pidfd_prepare(scm->pid, 0, &pidfd_file);
> + err = pidfd_valida
make sure any future changes will not leave
> a dangling pointer in pf->create() implementations.
>
> So this code is now redundant.
>
> Suggested-by: Kuniyuki Iwashima
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
future.
>
> Suggested-by: Kuniyuki Iwashima
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
e
> later.
>
> Clear the sock sk pointer on error.
>
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
e
> later.
>
> Clear the sk pointer in the sock object on error.
>
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
t; may allow use-after-free.
>
> Clear the sk pointer in the sock object on error.
>
> Signed-off-by: Ignat Korchagin
> Reviewed-by: Miquel Raynal
Reviewed-by: Kuniyuki Iwashima
t;
> Signed-off-by: Ignat Korchagin
> Reviewed-by: Vincent Mailhol
Reviewed-by: Kuniyuki Iwashima
gt; Fix this by swapping calls to bt_sock_alloc() and rfcomm_dlc_alloc().
>
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
e-after-free in other code.
>
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
Checked all bt_sock_alloc() paths and confirmed only rfcomm and l2cap
need changes.
to use this pointer and cause use-after-free.
>
> Suggested-by: Eric Dumazet
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
> [PATCH v2 0/8] do not leave dangling sk pointers in pf->create functions
For the future patches, please specify the target tree, net or net-next.
From: Ignat Korchagin
Date: Mon, 7 Oct 2024 22:34:54 +0100
> Some protocol family create() implementations have an error path after
> allocating t
e sk pointer upon return from
> pf->create in __sock_create. We do know that pf->create always releases the
> allocated sk object on error, so if the pointer is not NULL, it is
> definitely dangling.
>
> Fixes: 6cd4a78d962b ("net: do not leave a dangling sk pointer, when socket
> creation fails")
> Signed-off-by: Ignat Korchagin
Reviewed-by: Kuniyuki Iwashima
From: syzbot
Date: Wed, 10 Jul 2024 09:04:21 -0700
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:22f902dfc51e Merge tag 'i2c-for-6.10-rc7' of git://git.ker..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=166ba6e198
> kernel con
onfirmed via email that these were
> intended to be run.
>
> Enable these two tests.
>
> Fixes: 13715acf8ab5 ("selftest: Add test for bind() conflicts.")
> Fixes: 2c042e8e54ef ("tcp: Add selftest for bind() and TIME_WAIT.")
> Signed-off-by:
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and
removes 'static' from settimeo() in network_helpers.c.
Signed-off-by: Kuniyuki Iwashima
---
tools/testing/selftests/bpf/network_helpers.c | 2 +-
tools/testing/selftests/bpf/network_helpers.h | 1 +
.../bpf/
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
ggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 2 ++
include/uapi/linux/bpf.h | 15 +++
kernel/bpf/syscall.c | 13 +
net/core/filter.c | 13 -
This commit adds a new sysctl option: net.ipv4.tcp_migrate_req. If this
option is enabled or eBPF program is attached, we will be able to migrate
child sockets from a listener to another in the same reuseport group after
close() or shutdown() syscalls.
Signed-off-by: Kuniyuki Iwashima
Reviewed
: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 1 +
net/core/filter.c | 10 ++
tools/include/uapi/linux/bpf.h | 1 +
3 files changed, 12 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 49371eba98ba..ab8584701334 100644
--- a/include
hen CPU 1 loses the race
CPU 3 looks up req2, unhashes it, then CPU 2 loses the race
...
Signed-off-by: Kuniyuki Iwashima
---
net/ipv4/inet_connection_sock.c | 30 +-
net/ipv4/tcp_ipv4.c | 20 ++--
net/ipv6/tcp_ipv6.c | 14 ++
timer will recover this
situation.
Signed-off-by: Kuniyuki Iwashima
---
net/core/request_sock.c | 1 +
net/ipv4/inet_connection_sock.c | 76 +
2 files changed, 68 insertions(+), 9 deletions(-)
diff --git a/net/core/request_sock.c b/net/core/request_so
:
https://lore.kernel.org/netdev/20201209030903.hhow5r53l6fmo...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/net/request_sock.h | 2 ++
net/core/request_sock.c | 37 +
net/ipv4/inet_connectio
have to decrement it later.
We will support migration by eBPF in the later commits.
Signed-off-by: Kuniyuki Iwashima
Signed-off-by: Martin KaFai Lau
---
include/net/sock_reuseport.h | 3 ++
net/core/sock_reuseport.c| 78 +---
2 files changed, 67 inser
ckets
- we cannot attach an eBPF prog to listening sockets via shutdowned
sockets
Note that when the number of sockets gets over U16_MAX, we try to detach a
closed socket randomly to make room for the new listening socket in
reuseport_grow().
Signed-off-by: Kuniyuki Iwashima
Signed-off-by: M
_socks.
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h | 5 ++-
net/core/sock_reuseport.c| 76 +++-
2 files changed, 60 insertions(+), 21 deletions(-)
diff --git a/include/net/sock_reuseport.h b/include/net/sock_reuseport.h
index 505f1e
ages and coverletter
RFC:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (11):
net: Introduce net.ipv4.tcp_migrate_req.
tcp: Add num_closed_socks to struct sock_reuseport.
tcp: Keep TCP_CLOSE sockets in the reuseport group.
ore, this patch adds a compile-time check to take care of the order
of sock_copy() and sk_tx_queue_clear() and removes sk_tx_queue_clear() from
sk_prot_alloc() so that it does the only allocation and its callers
initialize fields.
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwash
From: Tariq Toukan
Date: Thu, 28 Jan 2021 15:09:51 +0200
> On 1/28/2021 2:42 PM, Kuniyuki Iwashima wrote:
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
> &g
ewed-by: tag
v1: https://lore.kernel.org/netdev/20210127125018.7059-1-kun...@amazon.co.jp/
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
---
net/core/sock.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/core/sock.c b/net/core/so
From: Tariq Toukan
Date: Thu, 28 Jan 2021 13:07:26 +0200
> On 1/28/2021 4:19 AM, Kuniyuki Iwashima wrote:
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
> &g
) from sk_prot_alloc()
instead of sk_alloc() and sk_clone_lock()
v2: https://lore.kernel.org/netdev/20210127132215.10842-1-kun...@amazon.co.jp/
* Remove Reviewed-by: tag
v1: https://lore.kernel.org/netdev/20210127125018.7059-1-kun...@amazon.co.jp/
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-b
From: Eric Dumazet
Date: Wed, 27 Jan 2021 19:07:51 +0100
> On Wed, Jan 27, 2021 at 6:56 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 18:34:35 +0100
> > > On Wed, Jan 27, 2021 at 6:32 PM Kuniyuki Iwashima
> > &
From: Eric Dumazet
Date: Wed, 27 Jan 2021 18:34:35 +0100
> On Wed, Jan 27, 2021 at 6:32 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 18:05:24 +0100
> > > On Wed, Jan 27, 2021 at 5:52 PM Kuniyuki Iwashima
> > &
From: Eric Dumazet
Date: Wed, 27 Jan 2021 18:05:24 +0100
> On Wed, Jan 27, 2021 at 5:52 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 15:54:32 +0100
> > > On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima
> >
From: Eric Dumazet
Date: Wed, 27 Jan 2021 15:54:32 +0100
> On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima wrote:
> >
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_sock
From: Kuniyuki Iwashima
Date: Wed, 27 Jan 2021 21:50:18 +0900
> The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
> it instead in sk_alloc() and sk_clone_lock() to fix an issue
Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
---
net/core/sock.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index bbcd4b97eddd..5c665ee1415
Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
Reviewed-by: Amit Shah
---
net/core/sock.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index bbc
t in IPv4.
Fixes: 01770a166165 ("tcp: fix race condition when creating child sockets from
syncookies")
CC: Ricardo Dias
Signed-off-by: Kuniyuki Iwashima
Reviewed-by: Benjamin Herrenschmidt
---
net/ipv4/tcp_ipv4.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/
From: Martin KaFai Lau
Date: Mon, 14 Dec 2020 18:58:37 -0800
> On Tue, Dec 15, 2020 at 02:03:13AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Thu, 10 Dec 2020 10:49:15 -0800
> > > On Thu, Dec 10, 2020 at 02:15:38PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Thu, 10 Dec 2020 11:33:40 -0800
> On Thu, Dec 10, 2020 at 02:58:10PM +0900, Kuniyuki Iwashima wrote:
>
> [ ... ]
>
> > > > I've implemented one-by-one migration only for the accept queue for now.
> > > > In addition
From: Martin KaFai Lau
Date: Thu, 10 Dec 2020 10:49:15 -0800
> On Thu, Dec 10, 2020 at 02:15:38PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 9 Dec 2020 16:07:07 -0800
> > > On Tue, Dec 01, 2020 at 11:44:12PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Wed, 9 Dec 2020 17:53:19 -0800
> On Thu, Dec 10, 2020 at 01:57:19AM +0900, Kuniyuki Iwashima wrOAote:
> [ ... ]
>
> > > > > I think it is a bit complex to pass the new listener from
> > > > > reusepor
From: Martin KaFai Lau
Date: Wed, 9 Dec 2020 16:07:07 -0800
> On Tue, Dec 01, 2020 at 11:44:12PM +0900, Kuniyuki Iwashima wrote:
> > This patch renames reuseport_select_sock() to __reuseport_select_sock() and
> > adds two wrapper function of it to pass the migration type
From: Kuniyuki Iwashima
Date: Wed, 9 Dec 2020 17:05:09 +0900
> From: Martin KaFai Lau
> Date: Tue, 8 Dec 2020 19:09:03 -0800
> > On Tue, Dec 08, 2020 at 05:17:48PM +0900, Kuniyuki Iwashima wrote:
> > > From: Martin KaFai Lau
> > > Date: Mon, 7 Dec 2020
From: Martin KaFai Lau
Date: Tue, 8 Dec 2020 19:09:03 -0800
> On Tue, Dec 08, 2020 at 05:17:48PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 23:34:41 -0800
> > > On Tue, Dec 08, 2020 at 03:31:34PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Tue, 8 Dec 2020 00:13:28 -0800
> On Tue, Dec 08, 2020 at 03:27:14PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 12:14:38 -0800
> > > On Sun, Dec 06, 2020 at 01:03:07AM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 23:34:41 -0800
> On Tue, Dec 08, 2020 at 03:31:34PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 12:33:15 -0800
> > > On Thu, Dec 03, 2020 at 11:14:24PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 22:54:18 -0800
> On Tue, Dec 01, 2020 at 11:44:10PM +0900, Kuniyuki Iwashima wrote:
>
> > @@ -242,8 +244,12 @@ void reuseport_detach_sock(struct sock *sk)
> >
> > reuse->num_socks--;
> >
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 12:33:15 -0800
> On Thu, Dec 03, 2020 at 11:14:24PM +0900, Kuniyuki Iwashima wrote:
> > From: Eric Dumazet
> > Date: Tue, 1 Dec 2020 16:25:51 +0100
> > > On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 12:14:38 -0800
> On Sun, Dec 06, 2020 at 01:03:07AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Fri, 4 Dec 2020 17:42:41 -0800
> > > On Tue, Dec 01, 2020 at 11:44:10PM +0900,
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
.../bpf/prog_tests/select_reuseport_migrate.c | 173 ++
.../bpf/progs/test_select_reuseport_migrate.c | 53 ++
2 files changed, 226
, and the sk_hash of the listener is
always zero. So we pass zero as hash to bpf_run_sk_reuseport().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/core/filter.c | 19 +++
net/core/sock_reuseport.c | 21 +++--
net/ipv4
-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 8
net/core/filter.c | 22 ++
tools/include/uapi/linux/bpf.h | 8
3 files changed, 38 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index
is
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Link:
https://lore.kernel.org/netdev/20201123003828.xjpjdtk4ygl6t...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 4 ++--
include
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 2 ++
kernel/bpf/syscall.c | 13 +
tools/include/uapi/linux/bpf.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/include/uapi/linux/bpf.h b
from the reuseport group, we rewrite request_sock.rsk_listener and resume
processing the request.
Link: https://lore.kernel.org/bpf/202012020136.bf0z4guu-...@intel.com/
Reported-by: kernel test robot
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net
=dh...@mail.gmail.com/
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h | 2 +-
net/core/sock_reuseport.c| 16 +---
net/ipv4/inet_hashtables.c | 9 +++--
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git
it at accept()
before reqsk_fastopen_remove().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/ipv4/inet_connection_sock.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
do not use req->rsk_listener. However, in the third case of
TCP_SYN_RECV sockets, we take special care in the next commit.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/inet_connection_sock.h | 1 +
net/ipv4/inet_connection_sock.c| 68 +++
This reverts commit 607904c357c61adf20b8fd18af765e501d61a385 to use
spin_lock_bh_nested() in the next commit.
Link:
https://lore.kernel.org/netdev/9d290a57-49e1-04cd-2487-262b0d7c5...@gmail.com/
Signed-off-by: Kuniyuki Iwashima
CC: Waiman Long
---
include/linux/spinlock.h | 8
/SYN_RECV sockets in
the accept queue or NEW_SYN_RECV socket during 3WHS.
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 14 ++
tools/include/uapi/linux/bpf.h | 14 ++
2 files changed, 28 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include
ation rules
so that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h| 5 +++--
net/core/sock_reuseport.c
req_to_sk(req)->sk_hash because listener's hash is zero
* Update commit messages and coverletter
RFC:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (13):
tcp: Allow TCP_CLOSE sockets to hold the reuseport group.
bpf: Define migration t
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:50:00 -0800
> On Tue, Dec 01, 2020 at 11:44:18PM +0900, Kuniyuki Iwashima wrote:
> > This patch a
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:42:41 -0800
> On Tue, Dec 01, 2020 at 11:44:10PM +0900, Kuniyuki Iwashima wrote:
> [ ... ]
> > diff
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:31:03 -0800
> On Tue, Dec 01, 2020 at 11:44:08PM +0900, Kuniyuki Iwashima wrote:
> > This patch is a preparation pa
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 11:58:07 -0800
> On Tue, Dec 01, 2020 at 11:44:16PM +0900, Kuniyuki Iwashima wrote:
> > We will call sock_reuseport.p
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Thu, 3 Dec 2020 21:56:53 -0800
> On Thu, Dec 03, 2020 at 11:16:08PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
>
From: Eric Dumazet
Date: Thu, 3 Dec 2020 15:31:53 +0100
> On Thu, Dec 3, 2020 at 3:14 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Tue, 1 Dec 2020 16:25:51 +0100
> > > On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > > > This
From: Martin KaFai Lau
Date: Wed, 2 Dec 2020 20:24:02 -0800
> On Wed, Dec 02, 2020 at 11:19:02AM -0800, Martin KaFai Lau wrote:
> > On Tue, Dec 01, 2020 at 06:04:50PM -0800, Andrii Nakryiko wrote:
> > > On Tue, Dec 1, 2020 at 6:49 AM Kuniyuki Iwashima
> > >
From: Eric Dumazet
Date: Tue, 1 Dec 2020 16:25:51 +0100
> On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > This patch lets reuseport_detach_sock() return a pointer of struct sock,
> > which is used only by inet_unhash(). If it is not NULL,
> > inet_csk_reqsk_que
From: Eric Dumazet
Date: Tue, 1 Dec 2020 16:13:39 +0100
> On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > This patch renames reuseport_select_sock() to __reuseport_select_sock() and
> > adds two wrapper function of it to pass the migration type defined in the
>
, and the sk_hash of the listener is
always zero. Thus, we pass zero as hash to bpf_run_sk_reuseport().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/core/filter.c | 19 +++
net/core/sock_reuseport.c | 19 ++-
net/ipv4
-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 8
net/core/filter.c | 12 +++-
tools/include/uapi/linux/bpf.h | 8
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
.../bpf/prog_tests/migrate_reuseport.c| 164 ++
.../bpf/progs/test_migrate_reuseport_kern.c | 54 ++
2 files changed, 218
is
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Link:
https://lore.kernel.org/netdev/20201123003828.xjpjdtk4ygl6t...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 4 ++--
include
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 2 ++
kernel/bpf/syscall.c | 8
tools/include/uapi/linux/bpf.h | 2 ++
3 files changed, 12 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include
from the reuseport group, we rewrite request_sock.rsk_listener and resume
processing the request.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/inet_connection_sock.h | 12 +++
include/net/request_sock.h | 13
include/net
d not have the
reuseport group. Therefore, this patch also loosens such validation rules
so that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h
it at accept()
before reqsk_fastopen_remove().
Moreover, if TFO request caused RST before 3WHS has completed, it is held
in the listener's TFO queue to prevent DDoS attack. Thus, we also have to
migrate the requests in TFO queue.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyu
inconsistency and cause an error.
Therefore, if there are different kinds of sockets, we must attach an eBPF
program described in later commits.
Link:
https://lore.kernel.org/netdev/CAEfhGiyG8Y_amDZ2C8dQoQqjZJMHjTY76b=KBkTKcBtA=dh...@mail.gmail.com/
Reviewed-by: Benjamin Herrenschmi
/SYN_RECV sockets in
the accept queue or NEW_SYN_RECV socket during 3WHS.
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 14 ++
tools/include/uapi/linux/bpf.h | 14 ++
2 files changed, 28 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include
* Pass req_to_sk(req)->sk_hash because listener's hash is zero
* Update commit messages and coverletter
RFC v0:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (11):
tcp: Keep TCP_CLOSE sockets in the reuseport group.
bpf: Define m
From: Martin KaFai Lau
Date: Sun, 22 Nov 2020 16:40:20 -0800
> On Sat, Nov 21, 2020 at 07:13:22PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Thu, 19 Nov 2020 17:53:46 -0800
> > > On Fri, Nov 20, 2020 at 07:09:22AM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Thu, 19 Nov 2020 18:31:57 -0800
> On Fri, Nov 20, 2020 at 07:17:49AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 18 Nov 2020 17:49:13 -0800
> > > On Tue, Nov 17, 2020 at 06:40:15PM +0900, Kuniyuki Iwa
From: Martin KaFai Lau
Date: Thu, 19 Nov 2020 17:53:46 -0800
> On Fri, Nov 20, 2020 at 07:09:22AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 18 Nov 2020 15:50:17 -0800
> > > On Tue, Nov 17, 2020 at 06:40:18PM +0900, Kuniyuki Iwashima w
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 17:49:13 -0800
> On Tue, Nov 17, 2020 at 06:40:15PM +0900, Kuniyuki Iwashima wrote:
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 17:00:45 -0800
> On Tue, Nov 17, 2020 at 06:40:22PM +0900, Kuniyuki Iwashima wrote:
> > This patch makes it possible to select a new listener for socket migration
> > by eBPF.
> >
> > The noteworthy point is that we s
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 16:11:54 -0800
> On Tue, Nov 17, 2020 at 06:40:21PM +0900, Kuniyuki Iwashima wrote:
> > We will call sock_reuseport.prog for socket migration in the next commit,
> > so the eBPF program has to know which listener is closing in orde
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 15:50:17 -0800
> On Tue, Nov 17, 2020 at 06:40:18PM +0900, Kuniyuki Iwashima wrote:
> > This patch lets reuseport_detach_sock() return a pointer of struct sock,
> > which is used only by inet_unhash(). If
From: Eric Dumazet
Date: Wed, 18 Nov 2020 17:25:44 +0100
> On 11/17/20 10:40 AM, Kuniyuki Iwashima wrote:
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect in the current
> > implementati
From: David Laight
Date: Wed, 18 Nov 2020 09:18:24 +
> From: Kuniyuki Iwashima
> > Sent: 17 November 2020 09:40
> >
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect in the
This commit adds a new sysctl option: net.ipv4.tcp_migrate_req. If this
option is enabled, and then we call listen() for SO_REUSEPORT enabled
sockets and close one, we will be able to migrate its child sockets to
another listener.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki
() or
inet_csk_bind_conflict() which expect that such sockets should not have the
reuseport group. Therefore, this patch loosens such validation rules so
that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwa
BPF_MAP_TYPE_REUSEPORT_SOCKARRAY map.
This patch exposes the ID to the eBPF program.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 1 +
net/core/filter.c | 8
tools/include/uapi/linux/bpf.h | 1 +
4
1 - 100 of 107 matches
Mail list logo