[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 28 Oct 2021 18:40:35 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Liu Jian <liujian56@...wei.com>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Sitnicki <jakub@...udflare.com>,
Lorenz Bauer <lmb@...udflare.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
KP Singh <kpsingh@...nel.org>,
Network Development <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>, Cong Wang <xiyou.wangcong@...il.com>
Subject: Re: [PATHC bpf v5 2/3] selftests, bpf: Fix test_txmsg_ingress_parser error
On Fri, Oct 22, 2021 at 8:22 AM John Fastabend <john.fastabend@...il.com> wrote:
>
> Liu Jian wrote:
> > After "skmsg: lose offset info in sk_psock_skb_ingress", the test case
> > with ktls failed. This because ktls parser(tls_read_size) return value
> > is 285 not 256.
> >
> > the case like this:
> > tls_sk1 --> redir_sk --> tls_sk2
> > tls_sk1 sent out 512 bytes data, after tls related processing redir_sk
> > recved 570 btyes data, and redirect 512 (skb_use_parser) bytes data to
> > tls_sk2; but tls_sk2 needs 285 * 2 bytes data, receive timeout occurred.
> >
> > Signed-off-by: Liu Jian <liujian56@...wei.com>
> > ---
> > tools/testing/selftests/bpf/test_sockmap.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
> > index eefd445b96fc..06924917ad77 100644
> > --- a/tools/testing/selftests/bpf/test_sockmap.c
> > +++ b/tools/testing/selftests/bpf/test_sockmap.c
> > @@ -1680,6 +1680,8 @@ static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt)
> > {
> > txmsg_pass = 1;
> > skb_use_parser = 512;
> > + if (ktls == 1)
> > + skb_use_parser = 570;
> > opt->iov_length = 256;
> > opt->iov_count = 1;
> > opt->rate = 2;
> > --
> > 2.17.1
> >
>
> Hi Liu LGTM sorry about the delay there I thought I acked this already, but
> guess now.
>
> Acked-by: John Fastabend <john.fastabend@...il.com>
Hmm.
patch 1 is causing a crash.
./test_progs -t sockmap
#124 sockmap_basic:OK
#125 sockmap_ktls:OK
[ 15.391661] ==================================================================
[ 15.392635] BUG: KASAN: null-ptr-deref in dst_release+0x1d/0x80
[ 15.393337] Write of size 4 at addr 0000000000000042 by task test_progs/1358
[ 15.394144]
[ 15.394326] CPU: 3 PID: 1358 Comm: test_progs Tainted: G
O 5.15.0-rc3-01147-ge4bcff4e3384 #3617
[ 15.395415] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
[ 15.396653] Call Trace:
[ 15.396929] <IRQ>
[ 15.397163] dump_stack_lvl+0x44/0x57
[ 15.397569] ? dst_release+0x1d/0x80
[ 15.397970] kasan_report.cold.15+0x66/0xdf
[ 15.398430] ? dst_release+0x1d/0x80
[ 15.398824] ? sk_psock_verdict_apply+0x149/0x460
[ 15.399341] kasan_check_range+0x1c1/0x1e0
[ 15.399789] ? sk_psock_verdict_apply+0x149/0x460
[ 15.400308] dst_release+0x1d/0x80
[ 15.400679] skb_release_head_state+0x100/0x170
[ 15.401178] skb_release_all+0xe/0x50
[ 15.401580] kfree_skb+0xa1/0x230
[ 15.401957] sk_psock_verdict_apply+0x149/0x460
[ 15.402450] ? bpf_sk_redirect_map+0x2b/0x1a0
[ 15.402974] sk_psock_strp_read+0x239/0x550
[ 15.403452] __strp_recv+0x4a7/0x1b70
[ 15.403917] tcp_read_sock+0x1d2/0x760
Powered by blists - more mailing lists