[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73d3e5c5-a38b-6f83-3022-b0442203ad6b@redhat.com>
Date: Wed, 1 Feb 2023 18:53:44 +0100
From: Jesper Dangaard Brouer <jbrouer@...hat.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>,
Stanislav Fomichev <sdf@...gle.com>
Cc: brouer@...hat.com, netdev@...r.kernel.org, martin.lau@...nel.org,
ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
dsahern@...il.com, willemb@...gle.com, void@...ifault.com,
kuba@...nel.org, xdp-hints@...-project.net, bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next V2 2/4] selftests/bpf: xdp_hw_metadata cleanup
cause segfault
On 01/02/2023 18.46, Martin KaFai Lau wrote:
> On 2/1/23 9:31 AM, Jesper Dangaard Brouer wrote:
>> diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c
>> b/tools/testing/selftests/bpf/xdp_hw_metadata.c
>> index 3823b1c499cc..438083e34cce 100644
>> --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c
>> +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c
>> @@ -121,7 +121,7 @@ static void close_xsk(struct xsk *xsk)
>> xsk_umem__delete(xsk->umem);
>> if (xsk->socket)
>> xsk_socket__delete(xsk->socket);
>> - munmap(xsk->umem, UMEM_SIZE);
>> + munmap(xsk->umem_area, UMEM_SIZE);
>
> Ah. Good catch. This should also explain a similar issue that CI is
> seeing in the prog_tests/xdp_metadata.c.
Yes, very likely same bug in prog_tests/xdp_metadata.c.
It was super tricky (and time consuming) to find as I was debugging in
GDB and it didn't make sense that checking a value against NULL would
cause a segfault. Plus, sometimes it worked without issues.
We also need this fix:
diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
index e033d48288c0..241909d71c7e 100644
--- a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
+++ b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
@@ -121,7 +121,7 @@ static void close_xsk(struct xsk *xsk)
xsk_umem__delete(xsk->umem);
if (xsk->socket)
xsk_socket__delete(xsk->socket);
- munmap(xsk->umem, UMEM_SIZE);
+ munmap(xsk->umem_area, UMEM_SIZE);
}
Powered by blists - more mailing lists