* [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect
@ 2023-09-02 10:07 Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 1/7] bpf, sockmap: add BPF_F_PERMANENT flag for " Liu Jian
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
v3->v4: Change the two helpers's description.
Let BPF_F_PERMANENT takes precedence over apply/cork_bytes.
Liu Jian (7):
bpf, sockmap: add BPF_F_PERMANENT flag for skmsg redirect
selftests/bpf: Add txmsg permanently test for sockmap
selftests/bpf: Add txmsg redir permanently test for sockmap
selftests/bpf: add skmsg verdict tests
selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENT flag
selftests/bpf: add tests for verdict skmsg to itself
selftests/bpf: add tests for verdict skmsg to closed socket
include/linux/skmsg.h | 1 +
include/uapi/linux/bpf.h | 45 +++++--
net/core/skmsg.c | 6 +-
net/core/sock_map.c | 4 +-
net/ipv4/tcp_bpf.c | 15 ++-
tools/include/uapi/linux/bpf.h | 45 +++++--
.../selftests/bpf/prog_tests/sockmap_basic.c | 122 ++++++++++++++++++
.../selftests/bpf/progs/test_sockmap_kern.h | 3 +-
.../bpf/progs/test_sockmap_msg_verdict.c | 25 ++++
tools/testing/selftests/bpf/test_sockmap.c | 41 +++++-
10 files changed, 275 insertions(+), 32 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 1/7] bpf, sockmap: add BPF_F_PERMANENT flag for skmsg redirect
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 2/7] selftests/bpf: Add txmsg permanently test for sockmap Liu Jian
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
If the sockmap msg redirection function is used only to forward packets
and no other operation, the execution result of the BPF_SK_MSG_VERDICT
program is the same each time. In this case, the BPF program only needs to
be run once. Add BPF_F_PERMANENT flag to bpf_msg_redirect_map() and
bpf_msg_redirect_hash() to implement this ability.
Then we can enable this function in the bpf program as follows:
bpf_msg_redirect_hash(xx, xx, xx, BPF_F_INGRESS | BPF_F_PERMANENT);
Test results using netperf TCP_STREAM mode:
for i in 1 64 128 512 1k 2k 32k 64k 100k 500k 1m;then
netperf -T 1,2 -t TCP_STREAM -H 127.0.0.1 -l 20 -- -m $i -s 100m,100m -S 100m,100m
done
before:
3.84 246.52 496.89 1885.03 3415.29 6375.03 40749.09 48764.40 51611.34 55678.26 55992.78
after:
4.43 279.20 555.82 2080.79 3870.70 7105.44 41836.41 49709.75 51861.56 55211.00 54566.85
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
include/linux/skmsg.h | 1 +
include/uapi/linux/bpf.h | 45 ++++++++++++++++++++++++++--------
net/core/skmsg.c | 6 ++++-
net/core/sock_map.c | 4 +--
net/ipv4/tcp_bpf.c | 15 ++++++++----
tools/include/uapi/linux/bpf.h | 45 ++++++++++++++++++++++++++--------
6 files changed, 88 insertions(+), 28 deletions(-)
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index c1637515a8a4..acd7de85608b 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -83,6 +83,7 @@ struct sk_psock {
u32 cork_bytes;
u32 eval;
bool redir_ingress; /* undefined if sk_redir is null */
+ bool redir_permanent;
struct sk_msg *cork;
struct sk_psock_progs progs;
#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 8790b3962e4b..37f27dc8cf2b 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3020,11 +3020,23 @@ union bpf_attr {
* socket level. If the message *msg* is allowed to pass (i.e. if
* the verdict eBPF program returns **SK_PASS**), redirect it to
* the socket referenced by *map* (of type
- * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and
- * egress interfaces can be used for redirection. The
- * **BPF_F_INGRESS** value in *flags* is used to make the
- * distinction (ingress path is selected if the flag is present,
- * egress path otherwise). This is the only flag supported for now.
+ * **BPF_MAP_TYPE_SOCKMAP**) at index *key*.
+ *
+ * The following *flags* are supported:
+ *
+ * **BPF_F_INGRESS**
+ * Both ingress and egress interfaces can be used for redirection.
+ * The **BPF_F_INGRESS** value in *flags* is used to make the
+ * distinction. Ingress path is selected if the flag is present,
+ * egress path otherwise.
+ * **BPF_F_PERMANENT**
+ * Indicates that redirect verdict and the target socket should be
+ * remembered. The verdict program will not be run for subsequent
+ * packets, unless an error occurs when forwarding packets.
+ *
+ * **BPF_F_PERMANENT** cannot be use together with
+ * **bpf_msg_apply_bytes**\ () and **bpf_msg_cork_bytes**\ (). If
+ * **BPF_F_PERMANENT** is set apply_bytes and cork_bytes are ignored.
* Return
* **SK_PASS** on success, or **SK_DROP** on error.
*
@@ -3292,11 +3304,23 @@ union bpf_attr {
* socket level. If the message *msg* is allowed to pass (i.e. if
* the verdict eBPF program returns **SK_PASS**), redirect it to
* the socket referenced by *map* (of type
- * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and
- * egress interfaces can be used for redirection. The
- * **BPF_F_INGRESS** value in *flags* is used to make the
- * distinction (ingress path is selected if the flag is present,
- * egress path otherwise). This is the only flag supported for now.
+ * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*.
+ *
+ * The following *flags* are supported:
+ *
+ * **BPF_F_INGRESS**
+ * Both ingress and egress interfaces can be used for redirection.
+ * The **BPF_F_INGRESS** value in *flags* is used to make the
+ * distinction. Ingress path is selected if the flag is present,
+ * egress path otherwise.
+ * **BPF_F_PERMANENT**
+ * Indicates that redirect verdict and the target socket should be
+ * remembered. The verdict program will not be run for subsequent
+ * packets, unless an error occurs when forwarding packets.
+ *
+ * **BPF_F_PERMANENT** cannot be use together with
+ * **bpf_msg_apply_bytes**\ () and **bpf_msg_cork_bytes**\ (). If
+ * **BPF_F_PERMANENT** is set apply_bytes and cork_bytes are ignored.
* Return
* **SK_PASS** on success, or **SK_DROP** on error.
*
@@ -5897,6 +5921,7 @@ enum {
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
enum {
BPF_F_INGRESS = (1ULL << 0),
+ BPF_F_PERMANENT = (1ULL << 1),
};
/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index a0659fc29bcc..8eb9e7f99b07 100644
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
@@ -874,7 +874,11 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
msg->sk = sk;
ret = bpf_prog_run_pin_on_cpu(prog, msg);
ret = sk_psock_map_verd(ret, msg->sk_redir);
- psock->apply_bytes = msg->apply_bytes;
+ psock->redir_permanent = msg->flags & BPF_F_PERMANENT;
+ if (psock->redir_permanent)
+ msg->cork_bytes = msg->apply_bytes = 0;
+ else
+ psock->apply_bytes = msg->apply_bytes;
if (ret == __SK_REDIRECT) {
if (psock->sk_redir) {
sock_put(psock->sk_redir);
diff --git a/net/core/sock_map.c b/net/core/sock_map.c
index 8f07fea39d9e..d69092de176c 100644
--- a/net/core/sock_map.c
+++ b/net/core/sock_map.c
@@ -662,7 +662,7 @@ BPF_CALL_4(bpf_msg_redirect_map, struct sk_msg *, msg,
{
struct sock *sk;
- if (unlikely(flags & ~(BPF_F_INGRESS)))
+ if (unlikely(flags & ~(BPF_F_INGRESS | BPF_F_PERMANENT)))
return SK_DROP;
sk = __sock_map_lookup_elem(map, key);
@@ -1261,7 +1261,7 @@ BPF_CALL_4(bpf_msg_redirect_hash, struct sk_msg *, msg,
{
struct sock *sk;
- if (unlikely(flags & ~(BPF_F_INGRESS)))
+ if (unlikely(flags & ~(BPF_F_INGRESS | BPF_F_PERMANENT)))
return SK_DROP;
sk = __sock_hash_lookup_elem(map, key);
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index 81f0dff69e0b..f7219f2d5c01 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -419,8 +419,10 @@ static int tcp_bpf_send_verdict(struct sock *sk, struct sk_psock *psock,
if (!psock->apply_bytes) {
/* Clean up before releasing the sock lock. */
eval = psock->eval;
- psock->eval = __SK_NONE;
- psock->sk_redir = NULL;
+ if (!psock->redir_permanent) {
+ psock->eval = __SK_NONE;
+ psock->sk_redir = NULL;
+ }
}
if (psock->cork) {
cork = true;
@@ -433,8 +435,11 @@ static int tcp_bpf_send_verdict(struct sock *sk, struct sk_psock *psock,
ret = tcp_bpf_sendmsg_redir(sk_redir, redir_ingress,
msg, tosend, flags);
sent = origsize - msg->sg.size;
+ /* disable the ability when something wrong */
+ if (unlikely(ret < 0))
+ psock->redir_permanent = false;
- if (eval == __SK_REDIRECT)
+ if (!psock->redir_permanent && eval == __SK_REDIRECT)
sock_put(sk_redir);
lock_sock(sk);
@@ -460,8 +465,8 @@ static int tcp_bpf_send_verdict(struct sock *sk, struct sk_psock *psock,
}
if (likely(!ret)) {
- if (!psock->apply_bytes) {
- psock->eval = __SK_NONE;
+ if (!psock->apply_bytes && !psock->redir_permanent) {
+ psock->eval = __SK_NONE;
if (psock->sk_redir) {
sock_put(psock->sk_redir);
psock->sk_redir = NULL;
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 8790b3962e4b..37f27dc8cf2b 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -3020,11 +3020,23 @@ union bpf_attr {
* socket level. If the message *msg* is allowed to pass (i.e. if
* the verdict eBPF program returns **SK_PASS**), redirect it to
* the socket referenced by *map* (of type
- * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and
- * egress interfaces can be used for redirection. The
- * **BPF_F_INGRESS** value in *flags* is used to make the
- * distinction (ingress path is selected if the flag is present,
- * egress path otherwise). This is the only flag supported for now.
+ * **BPF_MAP_TYPE_SOCKMAP**) at index *key*.
+ *
+ * The following *flags* are supported:
+ *
+ * **BPF_F_INGRESS**
+ * Both ingress and egress interfaces can be used for redirection.
+ * The **BPF_F_INGRESS** value in *flags* is used to make the
+ * distinction. Ingress path is selected if the flag is present,
+ * egress path otherwise.
+ * **BPF_F_PERMANENT**
+ * Indicates that redirect verdict and the target socket should be
+ * remembered. The verdict program will not be run for subsequent
+ * packets, unless an error occurs when forwarding packets.
+ *
+ * **BPF_F_PERMANENT** cannot be use together with
+ * **bpf_msg_apply_bytes**\ () and **bpf_msg_cork_bytes**\ (). If
+ * **BPF_F_PERMANENT** is set apply_bytes and cork_bytes are ignored.
* Return
* **SK_PASS** on success, or **SK_DROP** on error.
*
@@ -3292,11 +3304,23 @@ union bpf_attr {
* socket level. If the message *msg* is allowed to pass (i.e. if
* the verdict eBPF program returns **SK_PASS**), redirect it to
* the socket referenced by *map* (of type
- * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and
- * egress interfaces can be used for redirection. The
- * **BPF_F_INGRESS** value in *flags* is used to make the
- * distinction (ingress path is selected if the flag is present,
- * egress path otherwise). This is the only flag supported for now.
+ * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*.
+ *
+ * The following *flags* are supported:
+ *
+ * **BPF_F_INGRESS**
+ * Both ingress and egress interfaces can be used for redirection.
+ * The **BPF_F_INGRESS** value in *flags* is used to make the
+ * distinction. Ingress path is selected if the flag is present,
+ * egress path otherwise.
+ * **BPF_F_PERMANENT**
+ * Indicates that redirect verdict and the target socket should be
+ * remembered. The verdict program will not be run for subsequent
+ * packets, unless an error occurs when forwarding packets.
+ *
+ * **BPF_F_PERMANENT** cannot be use together with
+ * **bpf_msg_apply_bytes**\ () and **bpf_msg_cork_bytes**\ (). If
+ * **BPF_F_PERMANENT** is set apply_bytes and cork_bytes are ignored.
* Return
* **SK_PASS** on success, or **SK_DROP** on error.
*
@@ -5897,6 +5921,7 @@ enum {
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
enum {
BPF_F_INGRESS = (1ULL << 0),
+ BPF_F_PERMANENT = (1ULL << 1),
};
/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 2/7] selftests/bpf: Add txmsg permanently test for sockmap
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 1/7] bpf, sockmap: add BPF_F_PERMANENT flag for " Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 3/7] selftests/bpf: Add txmsg redir " Liu Jian
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add one test for txmsg ingress permanently test for sockmap.
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
tools/testing/selftests/bpf/test_sockmap.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 024a0faafb3b..bf2cef7ae3ae 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -77,6 +77,7 @@ int txmsg_end_push;
int txmsg_start_pop;
int txmsg_pop;
int txmsg_ingress;
+int txmsg_permanent;
int txmsg_redir_skb;
int txmsg_ktls_skb;
int txmsg_ktls_skb_drop;
@@ -107,6 +108,7 @@ static const struct option long_options[] = {
{"txmsg_start_pop", required_argument, NULL, 'w'},
{"txmsg_pop", required_argument, NULL, 'x'},
{"txmsg_ingress", no_argument, &txmsg_ingress, 1 },
+ {"txmsg_permanent", no_argument, &txmsg_permanent, 1 },
{"txmsg_redir_skb", no_argument, &txmsg_redir_skb, 1 },
{"ktls", no_argument, &ktls, 1 },
{"peek", no_argument, &peek_flag, 1 },
@@ -175,7 +177,7 @@ static void test_reset(void)
txmsg_start_push = txmsg_end_push = 0;
txmsg_pass = txmsg_drop = txmsg_redir = 0;
txmsg_apply = txmsg_cork = 0;
- txmsg_ingress = txmsg_redir_skb = 0;
+ txmsg_ingress = txmsg_permanent = txmsg_redir_skb = 0;
txmsg_ktls_skb = txmsg_ktls_skb_drop = txmsg_ktls_skb_redir = 0;
txmsg_omit_skb_parser = 0;
skb_use_parser = 0;
@@ -1165,10 +1167,13 @@ static int run_options(struct sockmap_options *options, int cg_fd, int test)
}
if (txmsg_ingress) {
- int in = BPF_F_INGRESS;
+ int txmsg_flag = BPF_F_INGRESS;
+
+ if (txmsg_permanent)
+ txmsg_flag |= BPF_F_PERMANENT;
i = 0;
- err = bpf_map_update_elem(map_fd[6], &i, &in, BPF_ANY);
+ err = bpf_map_update_elem(map_fd[6], &i, &txmsg_flag, BPF_ANY);
if (err) {
fprintf(stderr,
"ERROR: bpf_map_update_elem (txmsg_ingress): %d (%s)\n",
@@ -1506,6 +1511,14 @@ static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt)
test_send(opt, cgrp);
}
+static void test_txmsg_ingress_redir_permanent(int cgrp, struct sockmap_options *opt)
+{
+ txmsg_pass = txmsg_drop = 0;
+ txmsg_ingress = txmsg_redir = 1;
+ txmsg_permanent = 1;
+ test_send(opt, cgrp);
+}
+
static void test_txmsg_skb(int cgrp, struct sockmap_options *opt)
{
bool data = opt->data_test;
@@ -1862,6 +1875,7 @@ struct _test test[] = {
{"txmsg test redirect wait send mem", test_txmsg_redir_wait_sndmem},
{"txmsg test drop", test_txmsg_drop},
{"txmsg test ingress redirect", test_txmsg_ingress_redir},
+ {"txmsg test ingress redirect permanent", test_txmsg_ingress_redir_permanent},
{"txmsg test skb", test_txmsg_skb},
{"txmsg test apply", test_txmsg_apply},
{"txmsg test cork", test_txmsg_cork},
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 3/7] selftests/bpf: Add txmsg redir permanently test for sockmap
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 1/7] bpf, sockmap: add BPF_F_PERMANENT flag for " Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 2/7] selftests/bpf: Add txmsg permanently test for sockmap Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 4/7] selftests/bpf: add skmsg verdict tests Liu Jian
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add one test for txmsg redir permanently test for sockmap.
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
.../selftests/bpf/progs/test_sockmap_kern.h | 3 ++-
tools/testing/selftests/bpf/test_sockmap.c | 21 +++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_kern.h b/tools/testing/selftests/bpf/progs/test_sockmap_kern.h
index 99d2ea9fb658..b0a2ddd55b83 100644
--- a/tools/testing/selftests/bpf/progs/test_sockmap_kern.h
+++ b/tools/testing/selftests/bpf/progs/test_sockmap_kern.h
@@ -298,8 +298,9 @@ int bpf_prog6(struct sk_msg_md *msg)
f = bpf_map_lookup_elem(&sock_redir_flags, &zero);
if (f && *f) {
- key = 2;
flags = *f;
+ if (flags & BPF_F_INGRESS)
+ key = 2;
}
#ifdef SOCKMAP
return bpf_msg_redirect_map(msg, &sock_map_redir, key, flags);
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index bf2cef7ae3ae..c602ac8780a8 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -1166,6 +1166,19 @@ static int run_options(struct sockmap_options *options, int cg_fd, int test)
}
+ if (txmsg_permanent) {
+ int txmsg_flag = BPF_F_PERMANENT;
+
+ i = 0;
+ err = bpf_map_update_elem(map_fd[6], &i, &txmsg_flag, BPF_ANY);
+ if (err) {
+ fprintf(stderr,
+ "ERROR: bpf_map_update_elem (txmsg_permanent): %d (%s)\n",
+ err, strerror(errno));
+ goto out;
+ }
+ }
+
if (txmsg_ingress) {
int txmsg_flag = BPF_F_INGRESS;
@@ -1490,6 +1503,13 @@ static void test_txmsg_redir(int cgrp, struct sockmap_options *opt)
test_send(opt, cgrp);
}
+static void test_txmsg_redir_permanent(int cgrp, struct sockmap_options *opt)
+{
+ txmsg_redir = 1;
+ txmsg_permanent = 1;
+ test_send(opt, cgrp);
+}
+
static void test_txmsg_redir_wait_sndmem(int cgrp, struct sockmap_options *opt)
{
txmsg_redir = 1;
@@ -1872,6 +1892,7 @@ static int populate_progs(char *bpf_file)
struct _test test[] = {
{"txmsg test passthrough", test_txmsg_pass},
{"txmsg test redirect", test_txmsg_redir},
+ {"txmsg test redirect permanent", test_txmsg_redir_permanent},
{"txmsg test redirect wait send mem", test_txmsg_redir_wait_sndmem},
{"txmsg test drop", test_txmsg_drop},
{"txmsg test ingress redirect", test_txmsg_ingress_redir},
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 4/7] selftests/bpf: add skmsg verdict tests
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (2 preceding siblings ...)
2023-09-02 10:07 ` [PATCH bpf-next v4 3/7] selftests/bpf: Add txmsg redir " Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 5/7] selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENT flag Liu Jian
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add two normal skmsg verdict tests in sockmap_basic.c
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 71 +++++++++++++++++++
.../bpf/progs/test_sockmap_msg_verdict.c | 25 +++++++
2 files changed, 96 insertions(+)
create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index 064cc5e8d9ad..93bf1907abd9 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -12,6 +12,7 @@
#include "test_sockmap_progs_query.skel.h"
#include "test_sockmap_pass_prog.skel.h"
#include "test_sockmap_drop_prog.skel.h"
+#include "test_sockmap_msg_verdict.skel.h"
#include "bpf_iter_sockmap.skel.h"
#include "sockmap_helpers.h"
@@ -475,6 +476,72 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)
test_sockmap_drop_prog__destroy(drop);
}
+static void test_sockmap_msg_verdict(bool is_ingress)
+{
+ int key, sent, recvd, recv_fd;
+ int err, map, verdict, s, c0, c1, p0, p1;
+ struct test_sockmap_msg_verdict *skel;
+ char buf[256] = "0123456789";
+
+ skel = test_sockmap_msg_verdict__open_and_load();
+ if (!ASSERT_OK_PTR(skel, "open_and_load"))
+ return;
+ verdict = bpf_program__fd(skel->progs.prog_skmsg_verdict);
+ map = bpf_map__fd(skel->maps.sock_map);
+
+
+ err = bpf_prog_attach(verdict, map, BPF_SK_MSG_VERDICT, 0);
+ if (!ASSERT_OK(err, "bpf_prog_attach"))
+ goto out;
+
+ s = socket_loopback(AF_INET, SOCK_STREAM);
+ if (!ASSERT_GT(s, -1, "socket_loopback(s)"))
+ goto out;
+ err = create_socket_pairs(s, AF_INET, SOCK_STREAM, &c0, &c1, &p0, &p1);
+ if (!ASSERT_OK(err, "create_socket_pairs(s)"))
+ goto out;
+
+ key = 0;
+ err = bpf_map_update_elem(map, &key, &p1, BPF_NOEXIST);
+ if (!ASSERT_OK(err, "bpf_map_update_elem(key0)"))
+ goto out_close;
+ key = 1;
+ err = bpf_map_update_elem(map, &key, &c1, BPF_NOEXIST);
+ if (!ASSERT_OK(err, "bpf_map_update_elem(key1)"))
+ goto out_close;
+ key = 2;
+ err = bpf_map_update_elem(map, &key, &p0, BPF_NOEXIST);
+ if (!ASSERT_OK(err, "bpf_map_update_elem(key2)"))
+ goto out_close;
+ key = 3;
+ err = bpf_map_update_elem(map, &key, &c0, BPF_NOEXIST);
+ if (!ASSERT_OK(err, "bpf_map_update_elem(key3)"))
+ goto out_close;
+
+ if (is_ingress) {
+ recv_fd = c1;
+ skel->bss->skmsg_redir_flags = BPF_F_INGRESS;
+ skel->bss->skmsg_redir_key = 1;
+ } else {
+ recv_fd = c0;
+ skel->bss->skmsg_redir_flags = 0;
+ skel->bss->skmsg_redir_key = 2;
+ }
+
+ sent = xsend(p1, &buf, sizeof(buf), 0);
+ ASSERT_EQ(sent, sizeof(buf), "xsend(p1)");
+ recvd = recv_timeout(recv_fd, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
+ ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(recv_fd)");
+
+out_close:
+ close(c0);
+ close(p0);
+ close(c1);
+ close(p1);
+out:
+ test_sockmap_msg_verdict__destroy(skel);
+}
+
void test_sockmap_basic(void)
{
if (test__start_subtest("sockmap create_update_free"))
@@ -515,4 +582,8 @@ void test_sockmap_basic(void)
test_sockmap_skb_verdict_fionread(true);
if (test__start_subtest("sockmap skb_verdict fionread on drop"))
test_sockmap_skb_verdict_fionread(false);
+ if (test__start_subtest("sockmap msg_verdict"))
+ test_sockmap_msg_verdict(false);
+ if (test__start_subtest("sockmap msg_verdict ingress"))
+ test_sockmap_msg_verdict(true);
}
diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c b/tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c
new file mode 100644
index 000000000000..002b76a1ae35
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "vmlinux.h"
+#include <bpf/bpf_helpers.h>
+
+struct {
+ __uint(type, BPF_MAP_TYPE_SOCKMAP);
+ __uint(max_entries, 4);
+ __type(key, int);
+ __type(value, int);
+} sock_map SEC(".maps");
+
+u64 skmsg_redir_flags = 0;
+u32 skmsg_redir_key = 0;
+
+SEC("sk_msg")
+int prog_skmsg_verdict(struct sk_msg_md *msg)
+{
+ u64 flags = skmsg_redir_flags;
+ int key = skmsg_redir_key;
+
+ bpf_msg_redirect_map(msg, &sock_map, key, flags);
+ return SK_PASS;
+}
+
+char _license[] SEC("license") = "GPL";
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 5/7] selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENT flag
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (3 preceding siblings ...)
2023-09-02 10:07 ` [PATCH bpf-next v4 4/7] selftests/bpf: add skmsg verdict tests Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 6/7] selftests/bpf: add tests for verdict skmsg to itself Liu Jian
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add two tests for BPF_F_PERMANENT flag in sockmap_basic.c.
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index 93bf1907abd9..1a29e76fe29f 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -476,7 +476,7 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)
test_sockmap_drop_prog__destroy(drop);
}
-static void test_sockmap_msg_verdict(bool is_ingress)
+static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent)
{
int key, sent, recvd, recv_fd;
int err, map, verdict, s, c0, c1, p0, p1;
@@ -528,11 +528,18 @@ static void test_sockmap_msg_verdict(bool is_ingress)
skel->bss->skmsg_redir_key = 2;
}
+ if (is_permanent)
+ skel->bss->skmsg_redir_flags |= BPF_F_PERMANENT;
+
sent = xsend(p1, &buf, sizeof(buf), 0);
ASSERT_EQ(sent, sizeof(buf), "xsend(p1)");
recvd = recv_timeout(recv_fd, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(recv_fd)");
+ sent = xsend(p1, &buf, sizeof(buf), 0);
+ ASSERT_EQ(sent, sizeof(buf), "xsend(p1)");
+ recvd = recv_timeout(recv_fd, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
+ ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(recv_fd)");
out_close:
close(c0);
close(p0);
@@ -583,7 +590,11 @@ void test_sockmap_basic(void)
if (test__start_subtest("sockmap skb_verdict fionread on drop"))
test_sockmap_skb_verdict_fionread(false);
if (test__start_subtest("sockmap msg_verdict"))
- test_sockmap_msg_verdict(false);
+ test_sockmap_msg_verdict(false, false);
if (test__start_subtest("sockmap msg_verdict ingress"))
- test_sockmap_msg_verdict(true);
+ test_sockmap_msg_verdict(true, false);
+ if (test__start_subtest("sockmap msg_verdict permanent"))
+ test_sockmap_msg_verdict(false, true);
+ if (test__start_subtest("sockmap msg_verdict ingress permanent"))
+ test_sockmap_msg_verdict(true, true);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 6/7] selftests/bpf: add tests for verdict skmsg to itself
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (4 preceding siblings ...)
2023-09-02 10:07 ` [PATCH bpf-next v4 5/7] selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENT flag Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 7/7] selftests/bpf: add tests for verdict skmsg to closed socket Liu Jian
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add tests for verdict skmsg to itself in sockmap_basic.c
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 32 +++++++++++++------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index 1a29e76fe29f..1fcfa30720c6 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -476,7 +476,7 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)
test_sockmap_drop_prog__destroy(drop);
}
-static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent)
+static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent, bool is_self)
{
int key, sent, recvd, recv_fd;
int err, map, verdict, s, c0, c1, p0, p1;
@@ -519,13 +519,23 @@ static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent)
goto out_close;
if (is_ingress) {
- recv_fd = c1;
skel->bss->skmsg_redir_flags = BPF_F_INGRESS;
- skel->bss->skmsg_redir_key = 1;
+ if (is_self) {
+ skel->bss->skmsg_redir_key = 0;
+ recv_fd = p1;
+ } else {
+ skel->bss->skmsg_redir_key = 1;
+ recv_fd = c1;
+ }
} else {
- recv_fd = c0;
skel->bss->skmsg_redir_flags = 0;
- skel->bss->skmsg_redir_key = 2;
+ if (is_self) {
+ skel->bss->skmsg_redir_key = 0;
+ recv_fd = c1;
+ } else {
+ skel->bss->skmsg_redir_key = 2;
+ recv_fd = c0;
+ }
}
if (is_permanent)
@@ -590,11 +600,15 @@ void test_sockmap_basic(void)
if (test__start_subtest("sockmap skb_verdict fionread on drop"))
test_sockmap_skb_verdict_fionread(false);
if (test__start_subtest("sockmap msg_verdict"))
- test_sockmap_msg_verdict(false, false);
+ test_sockmap_msg_verdict(false, false, false);
if (test__start_subtest("sockmap msg_verdict ingress"))
- test_sockmap_msg_verdict(true, false);
+ test_sockmap_msg_verdict(true, false, false);
if (test__start_subtest("sockmap msg_verdict permanent"))
- test_sockmap_msg_verdict(false, true);
+ test_sockmap_msg_verdict(false, true, false);
if (test__start_subtest("sockmap msg_verdict ingress permanent"))
- test_sockmap_msg_verdict(true, true);
+ test_sockmap_msg_verdict(true, true, false);
+ if (test__start_subtest("sockmap msg_verdict permanent self"))
+ test_sockmap_msg_verdict(false, true, true);
+ if (test__start_subtest("sockmap msg_verdict ingress permanent self"))
+ test_sockmap_msg_verdict(true, true, true);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH bpf-next v4 7/7] selftests/bpf: add tests for verdict skmsg to closed socket
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (5 preceding siblings ...)
2023-09-02 10:07 ` [PATCH bpf-next v4 6/7] selftests/bpf: add tests for verdict skmsg to itself Liu Jian
@ 2023-09-02 10:07 ` Liu Jian
2023-09-08 12:29 ` [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Jakub Sitnicki
2023-09-12 17:21 ` Jakub Sitnicki
8 siblings, 0 replies; 12+ messages in thread
From: Liu Jian @ 2023-09-02 10:07 UTC (permalink / raw)
To: john.fastabend, jakub, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern
Cc: netdev, bpf, liujian56
Add four tests for verdict skmsg to closed socket in sockmap_basic.c.
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
.../selftests/bpf/prog_tests/sockmap_basic.c | 42 +++++++++++++++----
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index 1fcfa30720c6..dabea0997982 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -476,9 +476,10 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)
test_sockmap_drop_prog__destroy(drop);
}
-static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent, bool is_self)
+static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent, bool is_self,
+ bool target_shutdown)
{
- int key, sent, recvd, recv_fd;
+ int key, sent, recvd, recv_fd, target_fd;
int err, map, verdict, s, c0, c1, p0, p1;
struct test_sockmap_msg_verdict *skel;
char buf[256] = "0123456789";
@@ -522,18 +523,22 @@ static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent, bool is
skel->bss->skmsg_redir_flags = BPF_F_INGRESS;
if (is_self) {
skel->bss->skmsg_redir_key = 0;
+ target_fd = p1;
recv_fd = p1;
} else {
skel->bss->skmsg_redir_key = 1;
+ target_fd = c1;
recv_fd = c1;
}
} else {
skel->bss->skmsg_redir_flags = 0;
if (is_self) {
skel->bss->skmsg_redir_key = 0;
+ target_fd = p1;
recv_fd = c1;
} else {
skel->bss->skmsg_redir_key = 2;
+ target_fd = p0;
recv_fd = c0;
}
}
@@ -546,6 +551,19 @@ static void test_sockmap_msg_verdict(bool is_ingress, bool is_permanent, bool is
recvd = recv_timeout(recv_fd, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(recv_fd)");
+ if (target_shutdown) {
+ signal(SIGPIPE, SIG_IGN);
+ close(target_fd);
+ sent = send(p1, &buf, sizeof(buf), 0);
+ if (is_permanent) {
+ ASSERT_EQ(sent, -1, "xsend(p1)");
+ ASSERT_EQ(errno, EPIPE, "xsend(p1)");
+ } else {
+ ASSERT_EQ(sent, sizeof(buf), "xsend(p1)");
+ }
+ goto out_close;
+ }
+
sent = xsend(p1, &buf, sizeof(buf), 0);
ASSERT_EQ(sent, sizeof(buf), "xsend(p1)");
recvd = recv_timeout(recv_fd, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
@@ -600,15 +618,23 @@ void test_sockmap_basic(void)
if (test__start_subtest("sockmap skb_verdict fionread on drop"))
test_sockmap_skb_verdict_fionread(false);
if (test__start_subtest("sockmap msg_verdict"))
- test_sockmap_msg_verdict(false, false, false);
+ test_sockmap_msg_verdict(false, false, false, false);
if (test__start_subtest("sockmap msg_verdict ingress"))
- test_sockmap_msg_verdict(true, false, false);
+ test_sockmap_msg_verdict(true, false, false, false);
if (test__start_subtest("sockmap msg_verdict permanent"))
- test_sockmap_msg_verdict(false, true, false);
+ test_sockmap_msg_verdict(false, true, false, false);
if (test__start_subtest("sockmap msg_verdict ingress permanent"))
- test_sockmap_msg_verdict(true, true, false);
+ test_sockmap_msg_verdict(true, true, false, false);
if (test__start_subtest("sockmap msg_verdict permanent self"))
- test_sockmap_msg_verdict(false, true, true);
+ test_sockmap_msg_verdict(false, true, true, false);
if (test__start_subtest("sockmap msg_verdict ingress permanent self"))
- test_sockmap_msg_verdict(true, true, true);
+ test_sockmap_msg_verdict(true, true, true, false);
+ if (test__start_subtest("sockmap msg_verdict permanent shutdown"))
+ test_sockmap_msg_verdict(false, true, false, true);
+ if (test__start_subtest("sockmap msg_verdict ingress permanent shutdown"))
+ test_sockmap_msg_verdict(true, true, false, true);
+ if (test__start_subtest("sockmap msg_verdict shutdown"))
+ test_sockmap_msg_verdict(false, false, false, true);
+ if (test__start_subtest("sockmap msg_verdict ingress shutdown"))
+ test_sockmap_msg_verdict(true, false, false, true);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (6 preceding siblings ...)
2023-09-02 10:07 ` [PATCH bpf-next v4 7/7] selftests/bpf: add tests for verdict skmsg to closed socket Liu Jian
@ 2023-09-08 12:29 ` Jakub Sitnicki
2023-09-08 13:45 ` Daniel Borkmann
2023-09-12 17:21 ` Jakub Sitnicki
8 siblings, 1 reply; 12+ messages in thread
From: Jakub Sitnicki @ 2023-09-08 12:29 UTC (permalink / raw)
To: Liu Jian
Cc: john.fastabend, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern, netdev, bpf
On Sat, Sep 02, 2023 at 06:07 PM +08, Liu Jian wrote:
> v3->v4: Change the two helpers's description.
> Let BPF_F_PERMANENT takes precedence over apply/cork_bytes.
Sorry, will need some more time to review this.
I wanted to test it and noticed we have a regression in sockamp in
bpf-next @ 831c4b3f39c7:
# ./test_progs -t sockmap_listen
[ 17.941468] bpf_testmod: loading out-of-tree module taints kernel.
[ 17.941888] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
#213/1 sockmap_listen/sockmap IPv4 TCP test_insert_invalid:OK
#213/2 sockmap_listen/sockmap IPv4 TCP test_insert_opened:OK
#213/3 sockmap_listen/sockmap IPv4 TCP test_insert_bound:OK
#213/4 sockmap_listen/sockmap IPv4 TCP test_insert:OK
#213/5 sockmap_listen/sockmap IPv4 TCP test_delete_after_insert:OK
#213/6 sockmap_listen/sockmap IPv4 TCP test_delete_after_close:OK
#213/7 sockmap_listen/sockmap IPv4 TCP test_lookup_after_insert:OK
#213/8 sockmap_listen/sockmap IPv4 TCP test_lookup_after_delete:OK
#213/9 sockmap_listen/sockmap IPv4 TCP test_lookup_32_bit_value:OK
#213/10 sockmap_listen/sockmap IPv4 TCP test_update_existing:OK
#213/11 sockmap_listen/sockmap IPv4 TCP test_destroy_orphan_child:OK
#213/12 sockmap_listen/sockmap IPv4 TCP test_syn_recv_insert_delete:OK
#213/13 sockmap_listen/sockmap IPv4 TCP test_race_insert_listen:OK
#213/14 sockmap_listen/sockmap IPv4 TCP test_clone_after_delete:OK
#213/15 sockmap_listen/sockmap IPv4 TCP test_accept_after_delete:OK
#213/16 sockmap_listen/sockmap IPv4 TCP test_accept_before_delete:OK
#213/17 sockmap_listen/sockmap IPv4 UDP test_insert_invalid:OK
#213/18 sockmap_listen/sockmap IPv4 UDP test_insert_opened:OK
#213/19 sockmap_listen/sockmap IPv4 UDP test_insert:OK
#213/20 sockmap_listen/sockmap IPv4 UDP test_delete_after_insert:OK
#213/21 sockmap_listen/sockmap IPv4 UDP test_delete_after_close:OK
#213/22 sockmap_listen/sockmap IPv4 UDP test_lookup_after_insert:OK
#213/23 sockmap_listen/sockmap IPv4 UDP test_lookup_after_delete:OK
#213/24 sockmap_listen/sockmap IPv4 UDP test_lookup_32_bit_value:OK
#213/25 sockmap_listen/sockmap IPv4 UDP test_update_existing:OK
#213/26 sockmap_listen/sockmap IPv4 test_skb_redir_to_connected:OK
#213/27 sockmap_listen/sockmap IPv4 test_skb_redir_to_listening:OK
#213/28 sockmap_listen/sockmap IPv4 test_skb_redir_partial:OK
#213/29 sockmap_listen/sockmap IPv4 test_msg_redir_to_connected:OK
#213/30 sockmap_listen/sockmap IPv4 test_msg_redir_to_listening:OK
#213/31 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_listening:OK
#213/32 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_connected:OK
#213/33 sockmap_listen/sockmap IPv4 TCP test_reuseport_mixed_groups:OK
#213/34 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_listening:OK
#213/35 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_connected:OK
#213/36 sockmap_listen/sockmap IPv4 UDP test_reuseport_mixed_groups:OK
#213/37 sockmap_listen/sockmap IPv4 test_udp_redir:OK
#213/38 sockmap_listen/sockmap IPv4 test_udp_unix_redir:OK
#213/39 sockmap_listen/sockmap IPv6 TCP test_insert_invalid:OK
#213/40 sockmap_listen/sockmap IPv6 TCP test_insert_opened:OK
#213/41 sockmap_listen/sockmap IPv6 TCP test_insert_bound:OK
#213/42 sockmap_listen/sockmap IPv6 TCP test_insert:OK
#213/43 sockmap_listen/sockmap IPv6 TCP test_delete_after_insert:OK
#213/44 sockmap_listen/sockmap IPv6 TCP test_delete_after_close:OK
#213/45 sockmap_listen/sockmap IPv6 TCP test_lookup_after_insert:OK
#213/46 sockmap_listen/sockmap IPv6 TCP test_lookup_after_delete:OK
#213/47 sockmap_listen/sockmap IPv6 TCP test_lookup_32_bit_value:OK
#213/48 sockmap_listen/sockmap IPv6 TCP test_update_existing:OK
#213/49 sockmap_listen/sockmap IPv6 TCP test_destroy_orphan_child:OK
#213/50 sockmap_listen/sockmap IPv6 TCP test_syn_recv_insert_delete:OK
#213/51 sockmap_listen/sockmap IPv6 TCP test_race_insert_listen:OK
#213/52 sockmap_listen/sockmap IPv6 TCP test_clone_after_delete:OK
#213/53 sockmap_listen/sockmap IPv6 TCP test_accept_after_delete:OK
#213/54 sockmap_listen/sockmap IPv6 TCP test_accept_before_delete:OK
#213/55 sockmap_listen/sockmap IPv6 UDP test_insert_invalid:OK
#213/56 sockmap_listen/sockmap IPv6 UDP test_insert_opened:OK
#213/57 sockmap_listen/sockmap IPv6 UDP test_insert:OK
#213/58 sockmap_listen/sockmap IPv6 UDP test_delete_after_insert:OK
#213/59 sockmap_listen/sockmap IPv6 UDP test_delete_after_close:OK
#213/60 sockmap_listen/sockmap IPv6 UDP test_lookup_after_insert:OK
#213/61 sockmap_listen/sockmap IPv6 UDP test_lookup_after_delete:OK
#213/62 sockmap_listen/sockmap IPv6 UDP test_lookup_32_bit_value:OK
#213/63 sockmap_listen/sockmap IPv6 UDP test_update_existing:OK
#213/64 sockmap_listen/sockmap IPv6 test_skb_redir_to_connected:OK
#213/65 sockmap_listen/sockmap IPv6 test_skb_redir_to_listening:OK
#213/66 sockmap_listen/sockmap IPv6 test_skb_redir_partial:OK
#213/67 sockmap_listen/sockmap IPv6 test_msg_redir_to_connected:OK
#213/68 sockmap_listen/sockmap IPv6 test_msg_redir_to_listening:OK
#213/69 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_listening:OK
#213/70 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_connected:OK
#213/71 sockmap_listen/sockmap IPv6 TCP test_reuseport_mixed_groups:OK
#213/72 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_listening:OK
#213/73 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_connected:OK
#213/74 sockmap_listen/sockmap IPv6 UDP test_reuseport_mixed_groups:OK
#213/75 sockmap_listen/sockmap IPv6 test_udp_redir:OK
#213/76 sockmap_listen/sockmap IPv6 test_udp_unix_redir:OK
#213/77 sockmap_listen/sockmap Unix test_unix_redir:OK
#213/78 sockmap_listen/sockmap Unix test_unix_redir:OK
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
#213/79 sockmap_listen/sockmap VSOCK test_vsock_redir:FAIL
#213/80 sockmap_listen/sockhash IPv4 TCP test_insert_invalid:OK
#213/81 sockmap_listen/sockhash IPv4 TCP test_insert_opened:OK
#213/82 sockmap_listen/sockhash IPv4 TCP test_insert_bound:OK
#213/83 sockmap_listen/sockhash IPv4 TCP test_insert:OK
#213/84 sockmap_listen/sockhash IPv4 TCP test_delete_after_insert:OK
#213/85 sockmap_listen/sockhash IPv4 TCP test_delete_after_close:OK
#213/86 sockmap_listen/sockhash IPv4 TCP test_lookup_after_insert:OK
#213/87 sockmap_listen/sockhash IPv4 TCP test_lookup_after_delete:OK
#213/88 sockmap_listen/sockhash IPv4 TCP test_lookup_32_bit_value:OK
#213/89 sockmap_listen/sockhash IPv4 TCP test_update_existing:OK
#213/90 sockmap_listen/sockhash IPv4 TCP test_destroy_orphan_child:OK
#213/91 sockmap_listen/sockhash IPv4 TCP test_syn_recv_insert_delete:OK
#213/92 sockmap_listen/sockhash IPv4 TCP test_race_insert_listen:OK
#213/93 sockmap_listen/sockhash IPv4 TCP test_clone_after_delete:OK
#213/94 sockmap_listen/sockhash IPv4 TCP test_accept_after_delete:OK
#213/95 sockmap_listen/sockhash IPv4 TCP test_accept_before_delete:OK
#213/96 sockmap_listen/sockhash IPv4 UDP test_insert_invalid:OK
#213/97 sockmap_listen/sockhash IPv4 UDP test_insert_opened:OK
#213/98 sockmap_listen/sockhash IPv4 UDP test_insert:OK
#213/99 sockmap_listen/sockhash IPv4 UDP test_delete_after_insert:OK
#213/100 sockmap_listen/sockhash IPv4 UDP test_delete_after_close:OK
#213/101 sockmap_listen/sockhash IPv4 UDP test_lookup_after_insert:OK
#213/102 sockmap_listen/sockhash IPv4 UDP test_lookup_after_delete:OK
#213/103 sockmap_listen/sockhash IPv4 UDP test_lookup_32_bit_value:OK
#213/104 sockmap_listen/sockhash IPv4 UDP test_update_existing:OK
#213/105 sockmap_listen/sockhash IPv4 test_skb_redir_to_connected:OK
#213/106 sockmap_listen/sockhash IPv4 test_skb_redir_to_listening:OK
#213/107 sockmap_listen/sockhash IPv4 test_skb_redir_partial:OK
#213/108 sockmap_listen/sockhash IPv4 test_msg_redir_to_connected:OK
#213/109 sockmap_listen/sockhash IPv4 test_msg_redir_to_listening:OK
#213/110 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_listening:OK
#213/111 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_connected:OK
#213/112 sockmap_listen/sockhash IPv4 TCP test_reuseport_mixed_groups:OK
#213/113 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_listening:OK
#213/114 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_connected:OK
#213/115 sockmap_listen/sockhash IPv4 UDP test_reuseport_mixed_groups:OK
#213/116 sockmap_listen/sockhash IPv4 test_udp_redir:OK
#213/117 sockmap_listen/sockhash IPv4 test_udp_unix_redir:OK
#213/118 sockmap_listen/sockhash IPv6 TCP test_insert_invalid:OK
#213/119 sockmap_listen/sockhash IPv6 TCP test_insert_opened:OK
#213/120 sockmap_listen/sockhash IPv6 TCP test_insert_bound:OK
#213/121 sockmap_listen/sockhash IPv6 TCP test_insert:OK
#213/122 sockmap_listen/sockhash IPv6 TCP test_delete_after_insert:OK
#213/123 sockmap_listen/sockhash IPv6 TCP test_delete_after_close:OK
#213/124 sockmap_listen/sockhash IPv6 TCP test_lookup_after_insert:OK
#213/125 sockmap_listen/sockhash IPv6 TCP test_lookup_after_delete:OK
#213/126 sockmap_listen/sockhash IPv6 TCP test_lookup_32_bit_value:OK
#213/127 sockmap_listen/sockhash IPv6 TCP test_update_existing:OK
#213/128 sockmap_listen/sockhash IPv6 TCP test_destroy_orphan_child:OK
#213/129 sockmap_listen/sockhash IPv6 TCP test_syn_recv_insert_delete:OK
#213/130 sockmap_listen/sockhash IPv6 TCP test_race_insert_listen:OK
#213/131 sockmap_listen/sockhash IPv6 TCP test_clone_after_delete:OK
#213/132 sockmap_listen/sockhash IPv6 TCP test_accept_after_delete:OK
#213/133 sockmap_listen/sockhash IPv6 TCP test_accept_before_delete:OK
#213/134 sockmap_listen/sockhash IPv6 UDP test_insert_invalid:OK
#213/135 sockmap_listen/sockhash IPv6 UDP test_insert_opened:OK
#213/136 sockmap_listen/sockhash IPv6 UDP test_insert:OK
#213/137 sockmap_listen/sockhash IPv6 UDP test_delete_after_insert:OK
#213/138 sockmap_listen/sockhash IPv6 UDP test_delete_after_close:OK
#213/139 sockmap_listen/sockhash IPv6 UDP test_lookup_after_insert:OK
#213/140 sockmap_listen/sockhash IPv6 UDP test_lookup_after_delete:OK
#213/141 sockmap_listen/sockhash IPv6 UDP test_lookup_32_bit_value:OK
#213/142 sockmap_listen/sockhash IPv6 UDP test_update_existing:OK
#213/143 sockmap_listen/sockhash IPv6 test_skb_redir_to_connected:OK
#213/144 sockmap_listen/sockhash IPv6 test_skb_redir_to_listening:OK
#213/145 sockmap_listen/sockhash IPv6 test_skb_redir_partial:OK
#213/146 sockmap_listen/sockhash IPv6 test_msg_redir_to_connected:OK
#213/147 sockmap_listen/sockhash IPv6 test_msg_redir_to_listening:OK
#213/148 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_listening:OK
#213/149 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_connected:OK
#213/150 sockmap_listen/sockhash IPv6 TCP test_reuseport_mixed_groups:OK
#213/151 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_listening:OK
#213/152 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_connected:OK
#213/153 sockmap_listen/sockhash IPv6 UDP test_reuseport_mixed_groups:OK
#213/154 sockmap_listen/sockhash IPv6 test_udp_redir:OK
#213/155 sockmap_listen/sockhash IPv6 test_udp_unix_redir:OK
#213/156 sockmap_listen/sockhash Unix test_unix_redir:OK
#213/157 sockmap_listen/sockhash Unix test_unix_redir:OK
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
./test_progs:vsock_unix_redir_connectible:1501: ingress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
#213/158 sockmap_listen/sockhash VSOCK test_vsock_redir:FAIL
#213 sockmap_listen:FAIL
All error logs:
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
#213/79 sockmap_listen/sockmap VSOCK test_vsock_redir:FAIL
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
./test_progs:vsock_unix_redir_connectible:1501: egress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
./test_progs:vsock_unix_redir_connectible:1501: ingress: write: Transport endpoint is not connected
vsock_unix_redir_connectible:FAIL:1501
#213/158 sockmap_listen/sockhash VSOCK test_vsock_redir:FAIL
#213 sockmap_listen:FAIL
Summary: 0/156 PASSED, 0 SKIPPED, 1 FAILED
[ 18.853649] BUG: kernel NULL pointer dereference, address: 0000000000000008
[ 18.854041] #PF: supervisor write access in kernel mode
[ 18.854337] #PF: error_code(0x0002) - not-present page
[ 18.854605] PGD 104826067 P4D 104826067 PUD 104825067 PMD 0
[ 18.854918] Oops: 0002 [#1] PREEMPT SMP NOPTI
[ 18.855171] CPU: 3 PID: 50 Comm: kworker/3:1 Tainted: G OE 6.5.0+ #8
[ 18.855592] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
[ 18.856051] Workqueue: events sk_psock_destroy
[ 18.856294] RIP: 0010:skb_dequeue+0x4b/0x70
[ 18.856524] Code: 74 45 4d 85 e4 74 40 8b 43 10 83 e8 01 89 43 10 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00 <48> 89 42 08 48 89 10 4c 89 ef e8 e6 24 3b 00 4c 89 e0 5b 41 5c 41
[ 18.857516] RSP: 0018:ffffc900002cbdc0 EFLAGS: 00010097
[ 18.857798] RAX: 0000000000000000 RBX: ffff88810685e1b8 RCX: 363a88e2d5498366
[ 18.858186] RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff88810685e1d0
[ 18.858568] RBP: ffffc900002cbdd8 R08: 0000000000000000 R09: 0000000000080000
[ 18.858961] R10: 0000000000000394 R11: 0000000000000001 R12: ffff888102468b00
[ 18.859346] R13: ffff88810685e1d0 R14: ffff8881003da000 R15: ffff88810685e438
[ 18.859735] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
[ 18.860177] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 18.860486] CR2: 0000000000000008 CR3: 000000010480e005 CR4: 0000000000770ea0
[ 18.860868] PKRU: 55555554
[ 18.861017] Call Trace:
[ 18.861155] <TASK>
[ 18.861273] ? show_regs+0x60/0x70
[ 18.861468] ? __die+0x1f/0x70
[ 18.861633] ? page_fault_oops+0x80/0x160
[ 18.861845] ? do_user_addr_fault+0x320/0x7b0
[ 18.862084] ? __this_cpu_preempt_check+0x13/0x20
[ 18.862348] ? exc_page_fault+0x70/0x1c0
[ 18.862562] ? asm_exc_page_fault+0x27/0x30
[ 18.862785] ? skb_dequeue+0x4b/0x70
[ 18.862986] sk_psock_destroy+0x88/0x2e0
[ 18.863205] process_one_work+0x264/0x550
[ 18.863420] worker_thread+0x4d/0x3c0
[ 18.863624] ? process_one_work+0x550/0x550
[ 18.863855] kthread+0x106/0x140
[ 18.864031] ? kthread_complete_and_exit+0x20/0x20
[ 18.864281] ret_from_fork+0x35/0x60
[ 18.864480] ? kthread_complete_and_exit+0x20/0x20
[ 18.864730] ret_from_fork_asm+0x11/0x20
[ 18.864948] </TASK>
[ 18.865075] Modules linked in: bpf_testmod(OE)
[ 18.865320] CR2: 0000000000000008
[ 18.865493] ---[ end trace 0000000000000000 ]---
[ 18.865746] RIP: 0010:skb_dequeue+0x4b/0x70
[ 18.865976] Code: 74 45 4d 85 e4 74 40 8b 43 10 83 e8 01 89 43 10 49 8b 14 24 49 8b 44 24 08 49 c7 04 24 00 00 00 00 49 c7 44 24 08 00 00 00 00 <48> 89 42 08 48 89 10 4c 89 ef e8 e6 24 3b 00 4c 89 e0 5b 41 5c 41
[ 18.866968] RSP: 0018:ffffc900002cbdc0 EFLAGS: 00010097
[ 18.867246] RAX: 0000000000000000 RBX: ffff88810685e1b8 RCX: 363a88e2d5498366
[ 18.867638] RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff88810685e1d0
[ 18.868028] RBP: ffffc900002cbdd8 R08: 0000000000000000 R09: 0000000000080000
[ 18.868407] R10: 0000000000000394 R11: 0000000000000001 R12: ffff888102468b00
[ 18.868801] R13: ffff88810685e1d0 R14: ffff8881003da000 R15: ffff88810685e438
[ 18.869190] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
[ 18.869624] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 18.869944] CR2: 0000000000000008 CR3: 000000010480e005 CR4: 0000000000770ea0
[ 18.870327] PKRU: 55555554
[ 18.870486] Kernel panic - not syncing: Fatal exception
[ 18.870856] Kernel Offset: disabled
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect
2023-09-08 12:29 ` [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Jakub Sitnicki
@ 2023-09-08 13:45 ` Daniel Borkmann
0 siblings, 0 replies; 12+ messages in thread
From: Daniel Borkmann @ 2023-09-08 13:45 UTC (permalink / raw)
To: Jakub Sitnicki, Liu Jian
Cc: john.fastabend, ast, andrii, martin.lau, song, yonghong.song,
kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba, pabeni,
dsahern, netdev, bpf
On 9/8/23 2:29 PM, Jakub Sitnicki wrote:
> On Sat, Sep 02, 2023 at 06:07 PM +08, Liu Jian wrote:
>> v3->v4: Change the two helpers's description.
>> Let BPF_F_PERMANENT takes precedence over apply/cork_bytes.
>
> Sorry, will need some more time to review this.
>
> I wanted to test it and noticed we have a regression in sockamp in
> bpf-next @ 831c4b3f39c7:
All fixed in bpf, for testing pls use this tree until we have it over in bpf-next.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
` (7 preceding siblings ...)
2023-09-08 12:29 ` [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Jakub Sitnicki
@ 2023-09-12 17:21 ` Jakub Sitnicki
2023-09-15 1:05 ` liujian (CE)
8 siblings, 1 reply; 12+ messages in thread
From: Jakub Sitnicki @ 2023-09-12 17:21 UTC (permalink / raw)
To: Liu Jian
Cc: john.fastabend, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern, netdev, bpf
On Sat, Sep 02, 2023 at 06:07 PM +08, Liu Jian wrote:
> v3->v4: Change the two helpers's description.
> Let BPF_F_PERMANENT takes precedence over apply/cork_bytes.
I gave it another try. But somethings is still not right.
sockmap tests run cleanly for me on bpf tree @ 4eb94a779307.
But with this patch set applied I'm seeing a refcount splat. Please see
the sample session log at the end. Reproducible every time.
I've also included the warning itself with the stack trace decoded. Once
again, this is commit 4eb94a779307 with these patches on top.
I'm preparing for a talk that is in a few weeks [1], so unfortunately I
have limited cycles to help debug this.
[1] https://www.usenix.org/conference/srecon23emea/presentation/sitnicki
$ ./scripts/decode_stacktrace.sh ./vmlinux < trace.txt
[ 7.846863] ------------[ cut here ]------------
[ 7.847383] refcount_t: underflow; use-after-free.
[ 7.847919] WARNING: CPU: 3 PID: 36 at lib/refcount.c:28 refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
[ 7.848719] Modules linked in: bpf_testmod(OE)
[ 7.850364] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
[ 7.851893] Workqueue: events sk_psock_destroy
[ 7.852617] RIP: 0010:refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
[ 7.853383] Code: 01 e8 32 f0 a9 ff 0f 0b 5d c3 cc cc cc cc 80 3d 24 c5 01 02 00 75 81 48 c7 c7 98 cc 77 82 c6 05 14 c5 01 02 01 e8 0e f0 a9 ff <0f> 0b 5d c3 cc cc cc cc 80 3d 01 c5 01 02 00 0f 85 59 ff ff ff 48
All code
========
0: 01 e8 add %ebp,%eax
2: 32 f0 xor %al,%dh
4: a9 ff 0f 0b 5d test $0x5d0b0fff,%eax
9: c3 ret
a: cc int3
b: cc int3
c: cc int3
d: cc int3
e: 80 3d 24 c5 01 02 00 cmpb $0x0,0x201c524(%rip) # 0x201c539
15: 75 81 jne 0xffffffffffffff98
17: 48 c7 c7 98 cc 77 82 mov $0xffffffff8277cc98,%rdi
1e: c6 05 14 c5 01 02 01 movb $0x1,0x201c514(%rip) # 0x201c539
25: e8 0e f0 a9 ff call 0xffffffffffa9f038
2a:* 0f 0b ud2 <-- trapping instruction
2c: 5d pop %rbp
2d: c3 ret
2e: cc int3
2f: cc int3
30: cc int3
31: cc int3
32: 80 3d 01 c5 01 02 00 cmpb $0x0,0x201c501(%rip) # 0x201c53a
39: 0f 85 59 ff ff ff jne 0xffffffffffffff98
3f: 48 rex.W
Code starting with the faulting instruction
===========================================
0: 0f 0b ud2
2: 5d pop %rbp
3: c3 ret
4: cc int3
5: cc int3
6: cc int3
7: cc int3
8: 80 3d 01 c5 01 02 00 cmpb $0x0,0x201c501(%rip) # 0x201c510
f: 0f 85 59 ff ff ff jne 0xffffffffffffff6e
15: 48 rex.W
[ 7.855330] RSP: 0018:ffffc9000014bdd8 EFLAGS: 00010282
[ 7.855891] RAX: 0000000000000000 RBX: ffff888104ea0438 RCX: 0000000000000000
[ 7.856539] RDX: 0000000000000002 RSI: ffffc9000014bc50 RDI: 00000000ffffffff
[ 7.857348] RBP: ffffc9000014bdd8 R08: 0000000000000000 R09: ffffffff82e9bd60
[ 7.858088] R10: ffffc9000014bc48 R11: ffffffff8359bda8 R12: ffff888104ea0268
[ 7.858956] R13: ffff888104ea0268 R14: ffff888104ea0268 R15: dead000000000100
[ 7.859687] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
[ 7.860349] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7.861013] CR2: 00007f4e2d2a7f78 CR3: 0000000002e6e002 CR4: 0000000000770ea0
[ 7.862014] PKRU: 55555554
[ 7.862224] Call Trace:
[ 7.862515] <TASK>
[ 7.862719] ? show_regs (arch/x86/kernel/dumpstack.c:479)
[ 7.863159] ? __warn (kernel/panic.c:673)
[ 7.863521] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
[ 7.864073] ? report_bug (lib/bug.c:180 lib/bug.c:219)
[ 7.864523] ? handle_bug (arch/x86/kernel/traps.c:237)
[ 7.864954] ? exc_invalid_op (arch/x86/kernel/traps.c:258 (discriminator 1))
[ 7.865379] ? asm_exc_invalid_op (./arch/x86/include/asm/idtentry.h:568)
[ 7.866011] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
[ 7.866613] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
[ 7.867159] sk_psock_destroy (./include/linux/refcount.h:283 ./include/linux/refcount.h:315 ./include/linux/refcount.h:333 ./include/net/sock.h:1990 net/core/skmsg.c:828)
[ 7.867579] process_one_work (kernel/workqueue.c:2630)
[ 7.868120] worker_thread (kernel/workqueue.c:2697 (discriminator 2) kernel/workqueue.c:2784 (discriminator 2))
[ 7.868363] ? rescuer_thread (kernel/workqueue.c:2730)
[ 7.868589] kthread (kernel/kthread.c:388)
[ 7.869017] ? kthread_complete_and_exit (kernel/kthread.c:341)
[ 7.869716] ret_from_fork (arch/x86/kernel/process.c:147)
[ 7.870273] ? kthread_complete_and_exit (kernel/kthread.c:341)
[ 7.870889] ret_from_fork_asm (arch/x86/entry/entry_64.S:312)
[ 7.871374] </TASK>
[ 7.871818] irq event stamp: 2515
[ 7.872285] hardirqs last enabled at (2523): console_unlock (./arch/x86/include/asm/irqflags.h:42 ./arch/x86/include/asm/irqflags.h:77 ./arch/x86/include/asm/irqflags.h:135 kernel/printk/printk.c:347 kernel/printk/printk.c:2720 kernel/printk/printk.c:3039)
[ 7.873173] hardirqs last disabled at (2532): console_unlock (kernel/printk/printk.c:345 (discriminator 3) kernel/printk/printk.c:2720 (discriminator 3) kernel/printk/printk.c:3039 (discriminator 3))
[ 7.874103] softirqs last enabled at (2190): __do_softirq (./arch/x86/include/asm/preempt.h:27 kernel/softirq.c:400 kernel/softirq.c:582)
[ 7.875196] softirqs last disabled at (2185): irq_exit_rcu (kernel/softirq.c:427 kernel/softirq.c:632 kernel/softirq.c:644)
[ 7.875811] ---[ end trace 0000000000000000 ]---
--8<--
bash-5.2# ./test_progs -t sockmap
[ 7.691453] bpf_testmod: loading out-of-tree module taints kernel.
[ 7.691759] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
#24 bpf_sockmap_map_iter_fd:OK
#211/1 sockmap_basic/sockmap create_update_free:OK
#211/2 sockmap_basic/sockhash create_update_free:OK
#211/3 sockmap_basic/sockmap sk_msg load helpers:OK
#211/4 sockmap_basic/sockhash sk_msg load helpers:OK
#211/5 sockmap_basic/sockmap update:OK
#211/6 sockmap_basic/sockhash update:OK
#211/7 sockmap_basic/sockmap update in unsafe context:OK
#211/8 sockmap_basic/sockmap copy:OK
#211/9 sockmap_basic/sockhash copy:OK
#211/10 sockmap_basic/sockmap skb_verdict attach:OK
#211/11 sockmap_basic/sockmap msg_verdict progs query:OK
#211/12 sockmap_basic/sockmap stream_parser progs query:OK
#211/13 sockmap_basic/sockmap stream_verdict progs query:OK
#211/14 sockmap_basic/sockmap skb_verdict progs query:OK
#211/15 sockmap_basic/sockmap skb_verdict shutdown:OK
#211/16 sockmap_basic/sockmap skb_verdict fionread:OK
#211/17 sockmap_basic/sockmap skb_verdict fionread on drop:OK
#211/18 sockmap_basic/sockmap msg_verdict:OK
#211/19 sockmap_basic/sockmap msg_verdict ingress:OK
#211/20 sockmap_basic/sockmap msg_verdict permanent:OK
#211/21 sockmap_basic/sockmap msg_verdict ingress permanent:OK
#211/22 sockmap_basic/sockmap msg_verdict permanent self:OK
#211/23 sockmap_basic/sockmap msg_verdict ingress permanent self:OK
#211/24 sockmap_basic/sockmap msg_verdict permanent shutdown:OK
#211/25 sockmap_basic/sockmap msg_verdict ingress permanent shutdown:OK
#211/26 sockmap_basic/sockmap msg_verdict shutdown:OK
#211/27 sockmap_basic/sockmap msg_verdict ingress shutdown:OK
#211 sockmap_basic:OK
#212/1 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
#212/2 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
#212/3 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
#212/4 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
#212/5 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
#212/6 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
#212/7 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
#212/8 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
#212 sockmap_ktls:OK
[ 7.846863] ------------[ cut here ]------------
[ 7.847383] refcount_t: underflow; use-after-free.
[ 7.847919] WARNING: CPU: 3 PID: 36 at lib/refcount.c:28 refcount_warn_saturate+0xc2/0x110
[ 7.848719] Modules linked in: bpf_testmod(OE)
[ 7.849207] CPU: 3 PID: 36 Comm: kworker/3:0 Tainted: G OE 6.5.0+ #13
[ 7.850364] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
[ 7.851893] Workqueue: events sk_psock_destroy
[ 7.852617] RIP: 0010:refcount_warn_saturate+0xc2/0x110
[ 7.853383] Code: 01 e8 32 f0 a9 ff 0f 0b 5d c3 cc cc cc cc 80 3d 24 c5 01 02 00 75 81 48 c7 c7 98 cc 77 82 c6 05 14 c5 01 02 01 e8 0e f0 a9 ff <0f> 0b 5d c3 cc cc cc cc 80 3d 01 c5 01 02 00 0f 85 59 ff ff ff 48
[ 7.855330] RSP: 0018:ffffc9000014bdd8 EFLAGS: 00010282
[ 7.855891] RAX: 0000000000000000 RBX: ffff888104ea0438 RCX: 0000000000000000
[ 7.856539] RDX: 0000000000000002 RSI: ffffc9000014bc50 RDI: 00000000ffffffff
[ 7.857348] RBP: ffffc9000014bdd8 R08: 0000000000000000 R09: ffffffff82e9bd60
[ 7.858088] R10: ffffc9000014bc48 R11: ffffffff8359bda8 R12: ffff888104ea0268
[ 7.858956] R13: ffff888104ea0268 R14: ffff888104ea0268 R15: dead000000000100
[ 7.859687] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
[ 7.860349] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7.861013] CR2: 00007f4e2d2a7f78 CR3: 0000000002e6e002 CR4: 0000000000770ea0
[ 7.862014] PKRU: 55555554
[ 7.862224] Call Trace:
[ 7.862515] <TASK>
[ 7.862719] ? show_regs+0x60/0x70
[ 7.863159] ? __warn+0x84/0x180
[ 7.863521] ? refcount_warn_saturate+0xc2/0x110
[ 7.864073] ? report_bug+0x192/0x1c0
[ 7.864523] ? handle_bug+0x42/0x80
[ 7.864954] ? exc_invalid_op+0x18/0x70
[ 7.865379] ? asm_exc_invalid_op+0x1b/0x20
[ 7.866011] ? refcount_warn_saturate+0xc2/0x110
[ 7.866613] ? refcount_warn_saturate+0xc2/0x110
[ 7.867159] sk_psock_destroy+0x2c5/0x2e0
[ 7.867579] process_one_work+0x1fe/0x4f0
[ 7.868120] worker_thread+0x1d6/0x3d0
[ 7.868363] ? rescuer_thread+0x380/0x380
[ 7.868589] kthread+0x106/0x140
[ 7.869017] ? kthread_complete_and_exit+0x20/0x20
[ 7.869716] ret_from_fork+0x35/0x60
[ 7.870273] ? kthread_complete_and_exit+0x20/0x20
[ 7.870889] ret_from_fork_asm+0x11/0x20
[ 7.871374] </TASK>
[ 7.871818] irq event stamp: 2515
[ 7.872285] hardirqs last enabled at (2523): [<ffffffff811ae505>] console_unlock+0x105/0x130
[ 7.873173] hardirqs last disabled at (2532): [<ffffffff811ae4ea>] console_unlock+0xea/0x130
[ 7.874103] softirqs last enabled at (2190): [<ffffffff81d21495>] __do_softirq+0x2f5/0x3f3
[ 7.875196] softirqs last disabled at (2185): [<ffffffff8112d18f>] irq_exit_rcu+0x8f/0xf0
[ 7.875811] ---[ end trace 0000000000000000 ]---
#213/1 sockmap_listen/sockmap IPv4 TCP test_insert_invalid:OK
#213/2 sockmap_listen/sockmap IPv4 TCP test_insert_opened:OK
#213/3 sockmap_listen/sockmap IPv4 TCP test_insert_bound:OK
#213/4 sockmap_listen/sockmap IPv4 TCP test_insert:OK
#213/5 sockmap_listen/sockmap IPv4 TCP test_delete_after_insert:OK
#213/6 sockmap_listen/sockmap IPv4 TCP test_delete_after_close:OK
#213/7 sockmap_listen/sockmap IPv4 TCP test_lookup_after_insert:OK
#213/8 sockmap_listen/sockmap IPv4 TCP test_lookup_after_delete:OK
#213/9 sockmap_listen/sockmap IPv4 TCP test_lookup_32_bit_value:OK
#213/10 sockmap_listen/sockmap IPv4 TCP test_update_existing:OK
#213/11 sockmap_listen/sockmap IPv4 TCP test_destroy_orphan_child:OK
#213/12 sockmap_listen/sockmap IPv4 TCP test_syn_recv_insert_delete:OK
#213/13 sockmap_listen/sockmap IPv4 TCP test_race_insert_listen:OK
#213/14 sockmap_listen/sockmap IPv4 TCP test_clone_after_delete:OK
#213/15 sockmap_listen/sockmap IPv4 TCP test_accept_after_delete:OK
#213/16 sockmap_listen/sockmap IPv4 TCP test_accept_before_delete:OK
#213/17 sockmap_listen/sockmap IPv4 UDP test_insert_invalid:OK
#213/18 sockmap_listen/sockmap IPv4 UDP test_insert_opened:OK
#213/19 sockmap_listen/sockmap IPv4 UDP test_insert:OK
#213/20 sockmap_listen/sockmap IPv4 UDP test_delete_after_insert:OK
#213/21 sockmap_listen/sockmap IPv4 UDP test_delete_after_close:OK
#213/22 sockmap_listen/sockmap IPv4 UDP test_lookup_after_insert:OK
#213/23 sockmap_listen/sockmap IPv4 UDP test_lookup_after_delete:OK
#213/24 sockmap_listen/sockmap IPv4 UDP test_lookup_32_bit_value:OK
#213/25 sockmap_listen/sockmap IPv4 UDP test_update_existing:OK
#213/26 sockmap_listen/sockmap IPv4 test_skb_redir_to_connected:OK
#213/27 sockmap_listen/sockmap IPv4 test_skb_redir_to_listening:OK
#213/28 sockmap_listen/sockmap IPv4 test_skb_redir_partial:OK
#213/29 sockmap_listen/sockmap IPv4 test_msg_redir_to_connected:OK
#213/30 sockmap_listen/sockmap IPv4 test_msg_redir_to_listening:OK
#213/31 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_listening:OK
#213/32 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_connected:OK
#213/33 sockmap_listen/sockmap IPv4 TCP test_reuseport_mixed_groups:OK
#213/34 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_listening:OK
#213/35 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_connected:OK
#213/36 sockmap_listen/sockmap IPv4 UDP test_reuseport_mixed_groups:OK
#213/37 sockmap_listen/sockmap IPv4 test_udp_redir:OK
#213/38 sockmap_listen/sockmap IPv4 test_udp_unix_redir:OK
#213/39 sockmap_listen/sockmap IPv6 TCP test_insert_invalid:OK
#213/40 sockmap_listen/sockmap IPv6 TCP test_insert_opened:OK
#213/41 sockmap_listen/sockmap IPv6 TCP test_insert_bound:OK
#213/42 sockmap_listen/sockmap IPv6 TCP test_insert:OK
#213/43 sockmap_listen/sockmap IPv6 TCP test_delete_after_insert:OK
#213/44 sockmap_listen/sockmap IPv6 TCP test_delete_after_close:OK
#213/45 sockmap_listen/sockmap IPv6 TCP test_lookup_after_insert:OK
#213/46 sockmap_listen/sockmap IPv6 TCP test_lookup_after_delete:OK
#213/47 sockmap_listen/sockmap IPv6 TCP test_lookup_32_bit_value:OK
#213/48 sockmap_listen/sockmap IPv6 TCP test_update_existing:OK
#213/49 sockmap_listen/sockmap IPv6 TCP test_destroy_orphan_child:OK
#213/50 sockmap_listen/sockmap IPv6 TCP test_syn_recv_insert_delete:OK
#213/51 sockmap_listen/sockmap IPv6 TCP test_race_insert_listen:OK
#213/52 sockmap_listen/sockmap IPv6 TCP test_clone_after_delete:OK
#213/53 sockmap_listen/sockmap IPv6 TCP test_accept_after_delete:OK
#213/54 sockmap_listen/sockmap IPv6 TCP test_accept_before_delete:OK
#213/55 sockmap_listen/sockmap IPv6 UDP test_insert_invalid:OK
#213/56 sockmap_listen/sockmap IPv6 UDP test_insert_opened:OK
#213/57 sockmap_listen/sockmap IPv6 UDP test_insert:OK
#213/58 sockmap_listen/sockmap IPv6 UDP test_delete_after_insert:OK
#213/59 sockmap_listen/sockmap IPv6 UDP test_delete_after_close:OK
#213/60 sockmap_listen/sockmap IPv6 UDP test_lookup_after_insert:OK
#213/61 sockmap_listen/sockmap IPv6 UDP test_lookup_after_delete:OK
#213/62 sockmap_listen/sockmap IPv6 UDP test_lookup_32_bit_value:OK
#213/63 sockmap_listen/sockmap IPv6 UDP test_update_existing:OK
#213/64 sockmap_listen/sockmap IPv6 test_skb_redir_to_connected:OK
#213/65 sockmap_listen/sockmap IPv6 test_skb_redir_to_listening:OK
#213/66 sockmap_listen/sockmap IPv6 test_skb_redir_partial:OK
#213/67 sockmap_listen/sockmap IPv6 test_msg_redir_to_connected:OK
#213/68 sockmap_listen/sockmap IPv6 test_msg_redir_to_listening:OK
#213/69 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_listening:OK
#213/70 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_connected:OK
#213/71 sockmap_listen/sockmap IPv6 TCP test_reuseport_mixed_groups:OK
#213/72 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_listening:OK
#213/73 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_connected:OK
#213/74 sockmap_listen/sockmap IPv6 UDP test_reuseport_mixed_groups:OK
#213/75 sockmap_listen/sockmap IPv6 test_udp_redir:OK
#213/76 sockmap_listen/sockmap IPv6 test_udp_unix_redir:OK
#213/77 sockmap_listen/sockmap Unix test_unix_redir:OK
#213/78 sockmap_listen/sockmap Unix test_unix_redir:OK
#213/79 sockmap_listen/sockmap VSOCK test_vsock_redir:OK
#213/80 sockmap_listen/sockhash IPv4 TCP test_insert_invalid:OK
#213/81 sockmap_listen/sockhash IPv4 TCP test_insert_opened:OK
#213/82 sockmap_listen/sockhash IPv4 TCP test_insert_bound:OK
#213/83 sockmap_listen/sockhash IPv4 TCP test_insert:OK
#213/84 sockmap_listen/sockhash IPv4 TCP test_delete_after_insert:OK
#213/85 sockmap_listen/sockhash IPv4 TCP test_delete_after_close:OK
#213/86 sockmap_listen/sockhash IPv4 TCP test_lookup_after_insert:OK
#213/87 sockmap_listen/sockhash IPv4 TCP test_lookup_after_delete:OK
#213/88 sockmap_listen/sockhash IPv4 TCP test_lookup_32_bit_value:OK
#213/89 sockmap_listen/sockhash IPv4 TCP test_update_existing:OK
#213/90 sockmap_listen/sockhash IPv4 TCP test_destroy_orphan_child:OK
#213/91 sockmap_listen/sockhash IPv4 TCP test_syn_recv_insert_delete:OK
#213/92 sockmap_listen/sockhash IPv4 TCP test_race_insert_listen:OK
#213/93 sockmap_listen/sockhash IPv4 TCP test_clone_after_delete:OK
#213/94 sockmap_listen/sockhash IPv4 TCP test_accept_after_delete:OK
#213/95 sockmap_listen/sockhash IPv4 TCP test_accept_before_delete:OK
#213/96 sockmap_listen/sockhash IPv4 UDP test_insert_invalid:OK
#213/97 sockmap_listen/sockhash IPv4 UDP test_insert_opened:OK
#213/98 sockmap_listen/sockhash IPv4 UDP test_insert:OK
#213/99 sockmap_listen/sockhash IPv4 UDP test_delete_after_insert:OK
#213/100 sockmap_listen/sockhash IPv4 UDP test_delete_after_close:OK
#213/101 sockmap_listen/sockhash IPv4 UDP test_lookup_after_insert:OK
#213/102 sockmap_listen/sockhash IPv4 UDP test_lookup_after_delete:OK
#213/103 sockmap_listen/sockhash IPv4 UDP test_lookup_32_bit_value:OK
#213/104 sockmap_listen/sockhash IPv4 UDP test_update_existing:OK
#213/105 sockmap_listen/sockhash IPv4 test_skb_redir_to_connected:OK
#213/106 sockmap_listen/sockhash IPv4 test_skb_redir_to_listening:OK
#213/107 sockmap_listen/sockhash IPv4 test_skb_redir_partial:OK
#213/108 sockmap_listen/sockhash IPv4 test_msg_redir_to_connected:OK
#213/109 sockmap_listen/sockhash IPv4 test_msg_redir_to_listening:OK
#213/110 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_listening:OK
#213/111 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_connected:OK
#213/112 sockmap_listen/sockhash IPv4 TCP test_reuseport_mixed_groups:OK
#213/113 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_listening:OK
#213/114 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_connected:OK
#213/115 sockmap_listen/sockhash IPv4 UDP test_reuseport_mixed_groups:OK
#213/116 sockmap_listen/sockhash IPv4 test_udp_redir:OK
#213/117 sockmap_listen/sockhash IPv4 test_udp_unix_redir:OK
#213/118 sockmap_listen/sockhash IPv6 TCP test_insert_invalid:OK
#213/119 sockmap_listen/sockhash IPv6 TCP test_insert_opened:OK
#213/120 sockmap_listen/sockhash IPv6 TCP test_insert_bound:OK
#213/121 sockmap_listen/sockhash IPv6 TCP test_insert:OK
#213/122 sockmap_listen/sockhash IPv6 TCP test_delete_after_insert:OK
#213/123 sockmap_listen/sockhash IPv6 TCP test_delete_after_close:OK
#213/124 sockmap_listen/sockhash IPv6 TCP test_lookup_after_insert:OK
#213/125 sockmap_listen/sockhash IPv6 TCP test_lookup_after_delete:OK
#213/126 sockmap_listen/sockhash IPv6 TCP test_lookup_32_bit_value:OK
#213/127 sockmap_listen/sockhash IPv6 TCP test_update_existing:OK
#213/128 sockmap_listen/sockhash IPv6 TCP test_destroy_orphan_child:OK
#213/129 sockmap_listen/sockhash IPv6 TCP test_syn_recv_insert_delete:OK
#213/130 sockmap_listen/sockhash IPv6 TCP test_race_insert_listen:OK
#213/131 sockmap_listen/sockhash IPv6 TCP test_clone_after_delete:OK
#213/132 sockmap_listen/sockhash IPv6 TCP test_accept_after_delete:OK
#213/133 sockmap_listen/sockhash IPv6 TCP test_accept_before_delete:OK
#213/134 sockmap_listen/sockhash IPv6 UDP test_insert_invalid:OK
#213/135 sockmap_listen/sockhash IPv6 UDP test_insert_opened:OK
#213/136 sockmap_listen/sockhash IPv6 UDP test_insert:OK
#213/137 sockmap_listen/sockhash IPv6 UDP test_delete_after_insert:OK
#213/138 sockmap_listen/sockhash IPv6 UDP test_delete_after_close:OK
#213/139 sockmap_listen/sockhash IPv6 UDP test_lookup_after_insert:OK
#213/140 sockmap_listen/sockhash IPv6 UDP test_lookup_after_delete:OK
#213/141 sockmap_listen/sockhash IPv6 UDP test_lookup_32_bit_value:OK
#213/142 sockmap_listen/sockhash IPv6 UDP test_update_existing:OK
#213/143 sockmap_listen/sockhash IPv6 test_skb_redir_to_connected:OK
#213/144 sockmap_listen/sockhash IPv6 test_skb_redir_to_listening:OK
#213/145 sockmap_listen/sockhash IPv6 test_skb_redir_partial:OK
#213/146 sockmap_listen/sockhash IPv6 test_msg_redir_to_connected:OK
#213/147 sockmap_listen/sockhash IPv6 test_msg_redir_to_listening:OK
#213/148 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_listening:OK
#213/149 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_connected:OK
#213/150 sockmap_listen/sockhash IPv6 TCP test_reuseport_mixed_groups:OK
#213/151 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_listening:OK
#213/152 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_connected:OK
#213/153 sockmap_listen/sockhash IPv6 UDP test_reuseport_mixed_groups:OK
#213/154 sockmap_listen/sockhash IPv6 test_udp_redir:OK
#213/155 sockmap_listen/sockhash IPv6 test_udp_unix_redir:OK
#213/156 sockmap_listen/sockhash Unix test_unix_redir:OK
#213/157 sockmap_listen/sockhash Unix test_unix_redir:OK
#213/158 sockmap_listen/sockhash VSOCK test_vsock_redir:OK
#213 sockmap_listen:OK
Summary: 4/193 PASSED, 0 SKIPPED, 0 FAILED
bash-5.2#
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect
2023-09-12 17:21 ` Jakub Sitnicki
@ 2023-09-15 1:05 ` liujian (CE)
0 siblings, 0 replies; 12+ messages in thread
From: liujian (CE) @ 2023-09-15 1:05 UTC (permalink / raw)
To: Jakub Sitnicki
Cc: john.fastabend, ast, daniel, andrii, martin.lau, song,
yonghong.song, kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba,
pabeni, dsahern, netdev, bpf
On 2023/9/13 1:21, Jakub Sitnicki wrote:
> On Sat, Sep 02, 2023 at 06:07 PM +08, Liu Jian wrote:
>> v3->v4: Change the two helpers's description.
>> Let BPF_F_PERMANENT takes precedence over apply/cork_bytes.
>
> I gave it another try. But somethings is still not right.
>
> sockmap tests run cleanly for me on bpf tree @ 4eb94a779307.
>
> But with this patch set applied I'm seeing a refcount splat. Please see
> the sample session log at the end. Reproducible every time.
>
> I've also included the warning itself with the stack trace decoded. Once
> again, this is commit 4eb94a779307 with these patches on top.
>
> I'm preparing for a talk that is in a few weeks [1], so unfortunately I
> have limited cycles to help debug this.
I'll try and debug this issue. Thank you for taking the time to review it.
>
> [1] https://www.usenix.org/conference/srecon23emea/presentation/sitnicki
>
> $ ./scripts/decode_stacktrace.sh ./vmlinux < trace.txt
> [ 7.846863] ------------[ cut here ]------------
> [ 7.847383] refcount_t: underflow; use-after-free.
> [ 7.847919] WARNING: CPU: 3 PID: 36 at lib/refcount.c:28 refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
> [ 7.848719] Modules linked in: bpf_testmod(OE)
> [ 7.850364] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
> [ 7.851893] Workqueue: events sk_psock_destroy
> [ 7.852617] RIP: 0010:refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
> [ 7.853383] Code: 01 e8 32 f0 a9 ff 0f 0b 5d c3 cc cc cc cc 80 3d 24 c5 01 02 00 75 81 48 c7 c7 98 cc 77 82 c6 05 14 c5 01 02 01 e8 0e f0 a9 ff <0f> 0b 5d c3 cc cc cc cc 80 3d 01 c5 01 02 00 0f 85 59 ff ff ff 48
> All code
> ========
> 0: 01 e8 add %ebp,%eax
> 2: 32 f0 xor %al,%dh
> 4: a9 ff 0f 0b 5d test $0x5d0b0fff,%eax
> 9: c3 ret
> a: cc int3
> b: cc int3
> c: cc int3
> d: cc int3
> e: 80 3d 24 c5 01 02 00 cmpb $0x0,0x201c524(%rip) # 0x201c539
> 15: 75 81 jne 0xffffffffffffff98
> 17: 48 c7 c7 98 cc 77 82 mov $0xffffffff8277cc98,%rdi
> 1e: c6 05 14 c5 01 02 01 movb $0x1,0x201c514(%rip) # 0x201c539
> 25: e8 0e f0 a9 ff call 0xffffffffffa9f038
> 2a:* 0f 0b ud2 <-- trapping instruction
> 2c: 5d pop %rbp
> 2d: c3 ret
> 2e: cc int3
> 2f: cc int3
> 30: cc int3
> 31: cc int3
> 32: 80 3d 01 c5 01 02 00 cmpb $0x0,0x201c501(%rip) # 0x201c53a
> 39: 0f 85 59 ff ff ff jne 0xffffffffffffff98
> 3f: 48 rex.W
>
> Code starting with the faulting instruction
> ===========================================
> 0: 0f 0b ud2
> 2: 5d pop %rbp
> 3: c3 ret
> 4: cc int3
> 5: cc int3
> 6: cc int3
> 7: cc int3
> 8: 80 3d 01 c5 01 02 00 cmpb $0x0,0x201c501(%rip) # 0x201c510
> f: 0f 85 59 ff ff ff jne 0xffffffffffffff6e
> 15: 48 rex.W
> [ 7.855330] RSP: 0018:ffffc9000014bdd8 EFLAGS: 00010282
> [ 7.855891] RAX: 0000000000000000 RBX: ffff888104ea0438 RCX: 0000000000000000
> [ 7.856539] RDX: 0000000000000002 RSI: ffffc9000014bc50 RDI: 00000000ffffffff
> [ 7.857348] RBP: ffffc9000014bdd8 R08: 0000000000000000 R09: ffffffff82e9bd60
> [ 7.858088] R10: ffffc9000014bc48 R11: ffffffff8359bda8 R12: ffff888104ea0268
> [ 7.858956] R13: ffff888104ea0268 R14: ffff888104ea0268 R15: dead000000000100
> [ 7.859687] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
> [ 7.860349] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 7.861013] CR2: 00007f4e2d2a7f78 CR3: 0000000002e6e002 CR4: 0000000000770ea0
> [ 7.862014] PKRU: 55555554
> [ 7.862224] Call Trace:
> [ 7.862515] <TASK>
> [ 7.862719] ? show_regs (arch/x86/kernel/dumpstack.c:479)
> [ 7.863159] ? __warn (kernel/panic.c:673)
> [ 7.863521] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
> [ 7.864073] ? report_bug (lib/bug.c:180 lib/bug.c:219)
> [ 7.864523] ? handle_bug (arch/x86/kernel/traps.c:237)
> [ 7.864954] ? exc_invalid_op (arch/x86/kernel/traps.c:258 (discriminator 1))
> [ 7.865379] ? asm_exc_invalid_op (./arch/x86/include/asm/idtentry.h:568)
> [ 7.866011] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
> [ 7.866613] ? refcount_warn_saturate (lib/refcount.c:28 (discriminator 1))
> [ 7.867159] sk_psock_destroy (./include/linux/refcount.h:283 ./include/linux/refcount.h:315 ./include/linux/refcount.h:333 ./include/net/sock.h:1990 net/core/skmsg.c:828)
> [ 7.867579] process_one_work (kernel/workqueue.c:2630)
> [ 7.868120] worker_thread (kernel/workqueue.c:2697 (discriminator 2) kernel/workqueue.c:2784 (discriminator 2))
> [ 7.868363] ? rescuer_thread (kernel/workqueue.c:2730)
> [ 7.868589] kthread (kernel/kthread.c:388)
> [ 7.869017] ? kthread_complete_and_exit (kernel/kthread.c:341)
> [ 7.869716] ret_from_fork (arch/x86/kernel/process.c:147)
> [ 7.870273] ? kthread_complete_and_exit (kernel/kthread.c:341)
> [ 7.870889] ret_from_fork_asm (arch/x86/entry/entry_64.S:312)
> [ 7.871374] </TASK>
> [ 7.871818] irq event stamp: 2515
> [ 7.872285] hardirqs last enabled at (2523): console_unlock (./arch/x86/include/asm/irqflags.h:42 ./arch/x86/include/asm/irqflags.h:77 ./arch/x86/include/asm/irqflags.h:135 kernel/printk/printk.c:347 kernel/printk/printk.c:2720 kernel/printk/printk.c:3039)
> [ 7.873173] hardirqs last disabled at (2532): console_unlock (kernel/printk/printk.c:345 (discriminator 3) kernel/printk/printk.c:2720 (discriminator 3) kernel/printk/printk.c:3039 (discriminator 3))
> [ 7.874103] softirqs last enabled at (2190): __do_softirq (./arch/x86/include/asm/preempt.h:27 kernel/softirq.c:400 kernel/softirq.c:582)
> [ 7.875196] softirqs last disabled at (2185): irq_exit_rcu (kernel/softirq.c:427 kernel/softirq.c:632 kernel/softirq.c:644)
> [ 7.875811] ---[ end trace 0000000000000000 ]---
>
> --8<--
>
> bash-5.2# ./test_progs -t sockmap
> [ 7.691453] bpf_testmod: loading out-of-tree module taints kernel.
> [ 7.691759] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
> #24 bpf_sockmap_map_iter_fd:OK
> #211/1 sockmap_basic/sockmap create_update_free:OK
> #211/2 sockmap_basic/sockhash create_update_free:OK
> #211/3 sockmap_basic/sockmap sk_msg load helpers:OK
> #211/4 sockmap_basic/sockhash sk_msg load helpers:OK
> #211/5 sockmap_basic/sockmap update:OK
> #211/6 sockmap_basic/sockhash update:OK
> #211/7 sockmap_basic/sockmap update in unsafe context:OK
> #211/8 sockmap_basic/sockmap copy:OK
> #211/9 sockmap_basic/sockhash copy:OK
> #211/10 sockmap_basic/sockmap skb_verdict attach:OK
> #211/11 sockmap_basic/sockmap msg_verdict progs query:OK
> #211/12 sockmap_basic/sockmap stream_parser progs query:OK
> #211/13 sockmap_basic/sockmap stream_verdict progs query:OK
> #211/14 sockmap_basic/sockmap skb_verdict progs query:OK
> #211/15 sockmap_basic/sockmap skb_verdict shutdown:OK
> #211/16 sockmap_basic/sockmap skb_verdict fionread:OK
> #211/17 sockmap_basic/sockmap skb_verdict fionread on drop:OK
> #211/18 sockmap_basic/sockmap msg_verdict:OK
> #211/19 sockmap_basic/sockmap msg_verdict ingress:OK
> #211/20 sockmap_basic/sockmap msg_verdict permanent:OK
> #211/21 sockmap_basic/sockmap msg_verdict ingress permanent:OK
> #211/22 sockmap_basic/sockmap msg_verdict permanent self:OK
> #211/23 sockmap_basic/sockmap msg_verdict ingress permanent self:OK
> #211/24 sockmap_basic/sockmap msg_verdict permanent shutdown:OK
> #211/25 sockmap_basic/sockmap msg_verdict ingress permanent shutdown:OK
> #211/26 sockmap_basic/sockmap msg_verdict shutdown:OK
> #211/27 sockmap_basic/sockmap msg_verdict ingress shutdown:OK
> #211 sockmap_basic:OK
> #212/1 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
> #212/2 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
> #212/3 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
> #212/4 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
> #212/5 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
> #212/6 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
> #212/7 sockmap_ktls/sockmap_ktls disconnect_after_delete IPv4 SOCKMAP:OK
> #212/8 sockmap_ktls/sockmap_ktls update_fails_when_sock_has_ulp IPv4 SOCKMAP:OK
> #212 sockmap_ktls:OK
> [ 7.846863] ------------[ cut here ]------------
> [ 7.847383] refcount_t: underflow; use-after-free.
> [ 7.847919] WARNING: CPU: 3 PID: 36 at lib/refcount.c:28 refcount_warn_saturate+0xc2/0x110
> [ 7.848719] Modules linked in: bpf_testmod(OE)
> [ 7.849207] CPU: 3 PID: 36 Comm: kworker/3:0 Tainted: G OE 6.5.0+ #13
> [ 7.850364] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014
> [ 7.851893] Workqueue: events sk_psock_destroy
> [ 7.852617] RIP: 0010:refcount_warn_saturate+0xc2/0x110
> [ 7.853383] Code: 01 e8 32 f0 a9 ff 0f 0b 5d c3 cc cc cc cc 80 3d 24 c5 01 02 00 75 81 48 c7 c7 98 cc 77 82 c6 05 14 c5 01 02 01 e8 0e f0 a9 ff <0f> 0b 5d c3 cc cc cc cc 80 3d 01 c5 01 02 00 0f 85 59 ff ff ff 48
> [ 7.855330] RSP: 0018:ffffc9000014bdd8 EFLAGS: 00010282
> [ 7.855891] RAX: 0000000000000000 RBX: ffff888104ea0438 RCX: 0000000000000000
> [ 7.856539] RDX: 0000000000000002 RSI: ffffc9000014bc50 RDI: 00000000ffffffff
> [ 7.857348] RBP: ffffc9000014bdd8 R08: 0000000000000000 R09: ffffffff82e9bd60
> [ 7.858088] R10: ffffc9000014bc48 R11: ffffffff8359bda8 R12: ffff888104ea0268
> [ 7.858956] R13: ffff888104ea0268 R14: ffff888104ea0268 R15: dead000000000100
> [ 7.859687] FS: 0000000000000000(0000) GS:ffff88813bd80000(0000) knlGS:0000000000000000
> [ 7.860349] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 7.861013] CR2: 00007f4e2d2a7f78 CR3: 0000000002e6e002 CR4: 0000000000770ea0
> [ 7.862014] PKRU: 55555554
> [ 7.862224] Call Trace:
> [ 7.862515] <TASK>
> [ 7.862719] ? show_regs+0x60/0x70
> [ 7.863159] ? __warn+0x84/0x180
> [ 7.863521] ? refcount_warn_saturate+0xc2/0x110
> [ 7.864073] ? report_bug+0x192/0x1c0
> [ 7.864523] ? handle_bug+0x42/0x80
> [ 7.864954] ? exc_invalid_op+0x18/0x70
> [ 7.865379] ? asm_exc_invalid_op+0x1b/0x20
> [ 7.866011] ? refcount_warn_saturate+0xc2/0x110
> [ 7.866613] ? refcount_warn_saturate+0xc2/0x110
> [ 7.867159] sk_psock_destroy+0x2c5/0x2e0
> [ 7.867579] process_one_work+0x1fe/0x4f0
> [ 7.868120] worker_thread+0x1d6/0x3d0
> [ 7.868363] ? rescuer_thread+0x380/0x380
> [ 7.868589] kthread+0x106/0x140
> [ 7.869017] ? kthread_complete_and_exit+0x20/0x20
> [ 7.869716] ret_from_fork+0x35/0x60
> [ 7.870273] ? kthread_complete_and_exit+0x20/0x20
> [ 7.870889] ret_from_fork_asm+0x11/0x20
> [ 7.871374] </TASK>
> [ 7.871818] irq event stamp: 2515
> [ 7.872285] hardirqs last enabled at (2523): [<ffffffff811ae505>] console_unlock+0x105/0x130
> [ 7.873173] hardirqs last disabled at (2532): [<ffffffff811ae4ea>] console_unlock+0xea/0x130
> [ 7.874103] softirqs last enabled at (2190): [<ffffffff81d21495>] __do_softirq+0x2f5/0x3f3
> [ 7.875196] softirqs last disabled at (2185): [<ffffffff8112d18f>] irq_exit_rcu+0x8f/0xf0
> [ 7.875811] ---[ end trace 0000000000000000 ]---
> #213/1 sockmap_listen/sockmap IPv4 TCP test_insert_invalid:OK
> #213/2 sockmap_listen/sockmap IPv4 TCP test_insert_opened:OK
> #213/3 sockmap_listen/sockmap IPv4 TCP test_insert_bound:OK
> #213/4 sockmap_listen/sockmap IPv4 TCP test_insert:OK
> #213/5 sockmap_listen/sockmap IPv4 TCP test_delete_after_insert:OK
> #213/6 sockmap_listen/sockmap IPv4 TCP test_delete_after_close:OK
> #213/7 sockmap_listen/sockmap IPv4 TCP test_lookup_after_insert:OK
> #213/8 sockmap_listen/sockmap IPv4 TCP test_lookup_after_delete:OK
> #213/9 sockmap_listen/sockmap IPv4 TCP test_lookup_32_bit_value:OK
> #213/10 sockmap_listen/sockmap IPv4 TCP test_update_existing:OK
> #213/11 sockmap_listen/sockmap IPv4 TCP test_destroy_orphan_child:OK
> #213/12 sockmap_listen/sockmap IPv4 TCP test_syn_recv_insert_delete:OK
> #213/13 sockmap_listen/sockmap IPv4 TCP test_race_insert_listen:OK
> #213/14 sockmap_listen/sockmap IPv4 TCP test_clone_after_delete:OK
> #213/15 sockmap_listen/sockmap IPv4 TCP test_accept_after_delete:OK
> #213/16 sockmap_listen/sockmap IPv4 TCP test_accept_before_delete:OK
> #213/17 sockmap_listen/sockmap IPv4 UDP test_insert_invalid:OK
> #213/18 sockmap_listen/sockmap IPv4 UDP test_insert_opened:OK
> #213/19 sockmap_listen/sockmap IPv4 UDP test_insert:OK
> #213/20 sockmap_listen/sockmap IPv4 UDP test_delete_after_insert:OK
> #213/21 sockmap_listen/sockmap IPv4 UDP test_delete_after_close:OK
> #213/22 sockmap_listen/sockmap IPv4 UDP test_lookup_after_insert:OK
> #213/23 sockmap_listen/sockmap IPv4 UDP test_lookup_after_delete:OK
> #213/24 sockmap_listen/sockmap IPv4 UDP test_lookup_32_bit_value:OK
> #213/25 sockmap_listen/sockmap IPv4 UDP test_update_existing:OK
> #213/26 sockmap_listen/sockmap IPv4 test_skb_redir_to_connected:OK
> #213/27 sockmap_listen/sockmap IPv4 test_skb_redir_to_listening:OK
> #213/28 sockmap_listen/sockmap IPv4 test_skb_redir_partial:OK
> #213/29 sockmap_listen/sockmap IPv4 test_msg_redir_to_connected:OK
> #213/30 sockmap_listen/sockmap IPv4 test_msg_redir_to_listening:OK
> #213/31 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_listening:OK
> #213/32 sockmap_listen/sockmap IPv4 TCP test_reuseport_select_connected:OK
> #213/33 sockmap_listen/sockmap IPv4 TCP test_reuseport_mixed_groups:OK
> #213/34 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_listening:OK
> #213/35 sockmap_listen/sockmap IPv4 UDP test_reuseport_select_connected:OK
> #213/36 sockmap_listen/sockmap IPv4 UDP test_reuseport_mixed_groups:OK
> #213/37 sockmap_listen/sockmap IPv4 test_udp_redir:OK
> #213/38 sockmap_listen/sockmap IPv4 test_udp_unix_redir:OK
> #213/39 sockmap_listen/sockmap IPv6 TCP test_insert_invalid:OK
> #213/40 sockmap_listen/sockmap IPv6 TCP test_insert_opened:OK
> #213/41 sockmap_listen/sockmap IPv6 TCP test_insert_bound:OK
> #213/42 sockmap_listen/sockmap IPv6 TCP test_insert:OK
> #213/43 sockmap_listen/sockmap IPv6 TCP test_delete_after_insert:OK
> #213/44 sockmap_listen/sockmap IPv6 TCP test_delete_after_close:OK
> #213/45 sockmap_listen/sockmap IPv6 TCP test_lookup_after_insert:OK
> #213/46 sockmap_listen/sockmap IPv6 TCP test_lookup_after_delete:OK
> #213/47 sockmap_listen/sockmap IPv6 TCP test_lookup_32_bit_value:OK
> #213/48 sockmap_listen/sockmap IPv6 TCP test_update_existing:OK
> #213/49 sockmap_listen/sockmap IPv6 TCP test_destroy_orphan_child:OK
> #213/50 sockmap_listen/sockmap IPv6 TCP test_syn_recv_insert_delete:OK
> #213/51 sockmap_listen/sockmap IPv6 TCP test_race_insert_listen:OK
> #213/52 sockmap_listen/sockmap IPv6 TCP test_clone_after_delete:OK
> #213/53 sockmap_listen/sockmap IPv6 TCP test_accept_after_delete:OK
> #213/54 sockmap_listen/sockmap IPv6 TCP test_accept_before_delete:OK
> #213/55 sockmap_listen/sockmap IPv6 UDP test_insert_invalid:OK
> #213/56 sockmap_listen/sockmap IPv6 UDP test_insert_opened:OK
> #213/57 sockmap_listen/sockmap IPv6 UDP test_insert:OK
> #213/58 sockmap_listen/sockmap IPv6 UDP test_delete_after_insert:OK
> #213/59 sockmap_listen/sockmap IPv6 UDP test_delete_after_close:OK
> #213/60 sockmap_listen/sockmap IPv6 UDP test_lookup_after_insert:OK
> #213/61 sockmap_listen/sockmap IPv6 UDP test_lookup_after_delete:OK
> #213/62 sockmap_listen/sockmap IPv6 UDP test_lookup_32_bit_value:OK
> #213/63 sockmap_listen/sockmap IPv6 UDP test_update_existing:OK
> #213/64 sockmap_listen/sockmap IPv6 test_skb_redir_to_connected:OK
> #213/65 sockmap_listen/sockmap IPv6 test_skb_redir_to_listening:OK
> #213/66 sockmap_listen/sockmap IPv6 test_skb_redir_partial:OK
> #213/67 sockmap_listen/sockmap IPv6 test_msg_redir_to_connected:OK
> #213/68 sockmap_listen/sockmap IPv6 test_msg_redir_to_listening:OK
> #213/69 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_listening:OK
> #213/70 sockmap_listen/sockmap IPv6 TCP test_reuseport_select_connected:OK
> #213/71 sockmap_listen/sockmap IPv6 TCP test_reuseport_mixed_groups:OK
> #213/72 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_listening:OK
> #213/73 sockmap_listen/sockmap IPv6 UDP test_reuseport_select_connected:OK
> #213/74 sockmap_listen/sockmap IPv6 UDP test_reuseport_mixed_groups:OK
> #213/75 sockmap_listen/sockmap IPv6 test_udp_redir:OK
> #213/76 sockmap_listen/sockmap IPv6 test_udp_unix_redir:OK
> #213/77 sockmap_listen/sockmap Unix test_unix_redir:OK
> #213/78 sockmap_listen/sockmap Unix test_unix_redir:OK
> #213/79 sockmap_listen/sockmap VSOCK test_vsock_redir:OK
> #213/80 sockmap_listen/sockhash IPv4 TCP test_insert_invalid:OK
> #213/81 sockmap_listen/sockhash IPv4 TCP test_insert_opened:OK
> #213/82 sockmap_listen/sockhash IPv4 TCP test_insert_bound:OK
> #213/83 sockmap_listen/sockhash IPv4 TCP test_insert:OK
> #213/84 sockmap_listen/sockhash IPv4 TCP test_delete_after_insert:OK
> #213/85 sockmap_listen/sockhash IPv4 TCP test_delete_after_close:OK
> #213/86 sockmap_listen/sockhash IPv4 TCP test_lookup_after_insert:OK
> #213/87 sockmap_listen/sockhash IPv4 TCP test_lookup_after_delete:OK
> #213/88 sockmap_listen/sockhash IPv4 TCP test_lookup_32_bit_value:OK
> #213/89 sockmap_listen/sockhash IPv4 TCP test_update_existing:OK
> #213/90 sockmap_listen/sockhash IPv4 TCP test_destroy_orphan_child:OK
> #213/91 sockmap_listen/sockhash IPv4 TCP test_syn_recv_insert_delete:OK
> #213/92 sockmap_listen/sockhash IPv4 TCP test_race_insert_listen:OK
> #213/93 sockmap_listen/sockhash IPv4 TCP test_clone_after_delete:OK
> #213/94 sockmap_listen/sockhash IPv4 TCP test_accept_after_delete:OK
> #213/95 sockmap_listen/sockhash IPv4 TCP test_accept_before_delete:OK
> #213/96 sockmap_listen/sockhash IPv4 UDP test_insert_invalid:OK
> #213/97 sockmap_listen/sockhash IPv4 UDP test_insert_opened:OK
> #213/98 sockmap_listen/sockhash IPv4 UDP test_insert:OK
> #213/99 sockmap_listen/sockhash IPv4 UDP test_delete_after_insert:OK
> #213/100 sockmap_listen/sockhash IPv4 UDP test_delete_after_close:OK
> #213/101 sockmap_listen/sockhash IPv4 UDP test_lookup_after_insert:OK
> #213/102 sockmap_listen/sockhash IPv4 UDP test_lookup_after_delete:OK
> #213/103 sockmap_listen/sockhash IPv4 UDP test_lookup_32_bit_value:OK
> #213/104 sockmap_listen/sockhash IPv4 UDP test_update_existing:OK
> #213/105 sockmap_listen/sockhash IPv4 test_skb_redir_to_connected:OK
> #213/106 sockmap_listen/sockhash IPv4 test_skb_redir_to_listening:OK
> #213/107 sockmap_listen/sockhash IPv4 test_skb_redir_partial:OK
> #213/108 sockmap_listen/sockhash IPv4 test_msg_redir_to_connected:OK
> #213/109 sockmap_listen/sockhash IPv4 test_msg_redir_to_listening:OK
> #213/110 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_listening:OK
> #213/111 sockmap_listen/sockhash IPv4 TCP test_reuseport_select_connected:OK
> #213/112 sockmap_listen/sockhash IPv4 TCP test_reuseport_mixed_groups:OK
> #213/113 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_listening:OK
> #213/114 sockmap_listen/sockhash IPv4 UDP test_reuseport_select_connected:OK
> #213/115 sockmap_listen/sockhash IPv4 UDP test_reuseport_mixed_groups:OK
> #213/116 sockmap_listen/sockhash IPv4 test_udp_redir:OK
> #213/117 sockmap_listen/sockhash IPv4 test_udp_unix_redir:OK
> #213/118 sockmap_listen/sockhash IPv6 TCP test_insert_invalid:OK
> #213/119 sockmap_listen/sockhash IPv6 TCP test_insert_opened:OK
> #213/120 sockmap_listen/sockhash IPv6 TCP test_insert_bound:OK
> #213/121 sockmap_listen/sockhash IPv6 TCP test_insert:OK
> #213/122 sockmap_listen/sockhash IPv6 TCP test_delete_after_insert:OK
> #213/123 sockmap_listen/sockhash IPv6 TCP test_delete_after_close:OK
> #213/124 sockmap_listen/sockhash IPv6 TCP test_lookup_after_insert:OK
> #213/125 sockmap_listen/sockhash IPv6 TCP test_lookup_after_delete:OK
> #213/126 sockmap_listen/sockhash IPv6 TCP test_lookup_32_bit_value:OK
> #213/127 sockmap_listen/sockhash IPv6 TCP test_update_existing:OK
> #213/128 sockmap_listen/sockhash IPv6 TCP test_destroy_orphan_child:OK
> #213/129 sockmap_listen/sockhash IPv6 TCP test_syn_recv_insert_delete:OK
> #213/130 sockmap_listen/sockhash IPv6 TCP test_race_insert_listen:OK
> #213/131 sockmap_listen/sockhash IPv6 TCP test_clone_after_delete:OK
> #213/132 sockmap_listen/sockhash IPv6 TCP test_accept_after_delete:OK
> #213/133 sockmap_listen/sockhash IPv6 TCP test_accept_before_delete:OK
> #213/134 sockmap_listen/sockhash IPv6 UDP test_insert_invalid:OK
> #213/135 sockmap_listen/sockhash IPv6 UDP test_insert_opened:OK
> #213/136 sockmap_listen/sockhash IPv6 UDP test_insert:OK
> #213/137 sockmap_listen/sockhash IPv6 UDP test_delete_after_insert:OK
> #213/138 sockmap_listen/sockhash IPv6 UDP test_delete_after_close:OK
> #213/139 sockmap_listen/sockhash IPv6 UDP test_lookup_after_insert:OK
> #213/140 sockmap_listen/sockhash IPv6 UDP test_lookup_after_delete:OK
> #213/141 sockmap_listen/sockhash IPv6 UDP test_lookup_32_bit_value:OK
> #213/142 sockmap_listen/sockhash IPv6 UDP test_update_existing:OK
> #213/143 sockmap_listen/sockhash IPv6 test_skb_redir_to_connected:OK
> #213/144 sockmap_listen/sockhash IPv6 test_skb_redir_to_listening:OK
> #213/145 sockmap_listen/sockhash IPv6 test_skb_redir_partial:OK
> #213/146 sockmap_listen/sockhash IPv6 test_msg_redir_to_connected:OK
> #213/147 sockmap_listen/sockhash IPv6 test_msg_redir_to_listening:OK
> #213/148 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_listening:OK
> #213/149 sockmap_listen/sockhash IPv6 TCP test_reuseport_select_connected:OK
> #213/150 sockmap_listen/sockhash IPv6 TCP test_reuseport_mixed_groups:OK
> #213/151 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_listening:OK
> #213/152 sockmap_listen/sockhash IPv6 UDP test_reuseport_select_connected:OK
> #213/153 sockmap_listen/sockhash IPv6 UDP test_reuseport_mixed_groups:OK
> #213/154 sockmap_listen/sockhash IPv6 test_udp_redir:OK
> #213/155 sockmap_listen/sockhash IPv6 test_udp_unix_redir:OK
> #213/156 sockmap_listen/sockhash Unix test_unix_redir:OK
> #213/157 sockmap_listen/sockhash Unix test_unix_redir:OK
> #213/158 sockmap_listen/sockhash VSOCK test_vsock_redir:OK
> #213 sockmap_listen:OK
> Summary: 4/193 PASSED, 0 SKIPPED, 0 FAILED
> bash-5.2#
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-09-15 1:06 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-02 10:07 [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 1/7] bpf, sockmap: add BPF_F_PERMANENT flag for " Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 2/7] selftests/bpf: Add txmsg permanently test for sockmap Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 3/7] selftests/bpf: Add txmsg redir " Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 4/7] selftests/bpf: add skmsg verdict tests Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 5/7] selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENT flag Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 6/7] selftests/bpf: add tests for verdict skmsg to itself Liu Jian
2023-09-02 10:07 ` [PATCH bpf-next v4 7/7] selftests/bpf: add tests for verdict skmsg to closed socket Liu Jian
2023-09-08 12:29 ` [PATCH bpf-next v4 0/7] add BPF_F_PERMANENT flag for sockmap skmsg redirect Jakub Sitnicki
2023-09-08 13:45 ` Daniel Borkmann
2023-09-12 17:21 ` Jakub Sitnicki
2023-09-15 1:05 ` liujian (CE)
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).