* [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use
2026-11-16 13:07 [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Eva Kurchatova
@ 2026-11-16 13:07 ` Eva Kurchatova
2026-11-16 13:13 ` no-reply
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet Eva Kurchatova
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Eva Kurchatova @ 2026-11-16 13:07 UTC (permalink / raw)
To: khorenko; +Cc: devel
From: "Bastien Curutchet (eBPF Foundation)" <bastien.curutchet@bootlin.com>
bitmap is used before being initialized.
Initialize it to zero before using it.
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20251031-xsk-v7-2-39fe486593a3@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
(cherry picked from commit 2233ef8bba81e02e8fee6300a81dcf389aa17c58)
Rebase note: applied to xskxceiver.c. Mainline moved this code to
test_xsk.c in commit 3ab77f35a75e ("selftests/bpf: test_xsk: Split
xskxceiver"), which is not here. The code is the same.
https://virtuozzo.atlassian.net/browse/VSTOR-154851
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
tools/testing/selftests/bpf/xskxceiver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 04fda63b6350..014b20ef4aaf 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -1304,6 +1304,8 @@ static int receive_pkts(struct test_spec *test)
u32 sock_num = 0;
int res, ret;
+ bitmap_zero(bitmap, test->nb_sockets);
+
ret = gettimeofday(&tv_now, NULL);
if (ret)
exit_with_error(errno);
@@ -1494,6 +1496,8 @@ static int send_pkts(struct test_spec *test, struct ifobject *ifobject)
DECLARE_BITMAP(bitmap, test->nb_sockets);
u32 i, ret;
+ bitmap_zero(bitmap, test->nb_sockets);
+
while (!(all_packets_sent(test, bitmap))) {
for (i = 0; i < test->nb_sockets; i++) {
struct pkt_stream *pkt_stream;
--
2.56.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use Eva Kurchatova
@ 2026-11-16 13:13 ` no-reply
2026-11-16 13:40 ` Eva Kurchatova (Virtuozzo)
0 siblings, 1 reply; 8+ messages in thread
From: no-reply @ 2026-11-16 13:13 UTC (permalink / raw)
To: Eva Kurchatova, khorenko; +Cc: devel
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/bpf: xsk bitmap fix lacks Fixes: trailers
--
commit ee0829e53ca566bede00c40365c639ece9f4e9bd
Author: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
> ms/selftests/bpf: test_xsk: Initialize bitmap before use
>
> bitmap is used before being initialized.
>
> Initialize it to zero before using it.
>
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
> Link: https://lore.kernel.org/r/20251031-xsk-v7-2-39fe486593a3@bootlin.com
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> (cherry picked from commit 2233ef8bba81e02e8fee6300a81dcf389aa17c58)
>
> Rebase note: applied to xskxceiver.c. Mainline moved this code to
> test_xsk.c in commit 3ab77f35a75e ("selftests/bpf: test_xsk: Split
> xskxceiver"), which is not here. The code is the same.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-154851
> Feature: fix selftests
>
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
[Severity: Low]
This fixes reads of an uninitialized on-stack bitmap in receive_pkts() and
send_pkts(), but the message has no Fixes: tags. Should it include the
commits that introduced the two bugs?
Fixes: 8913e653e9b8 ("selftests/xsk: Iterate over all the sockets in the receive pkts function")
Fixes: fd0815ae9b8a ("selftests/xsk: Iterate over all the sockets in the send pkts function")
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116130936.612078-1-eva.kurchatova@virtuozzo.com?part=1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use
2026-11-16 13:13 ` no-reply
@ 2026-11-16 13:40 ` Eva Kurchatova (Virtuozzo)
0 siblings, 0 replies; 8+ messages in thread
From: Eva Kurchatova (Virtuozzo) @ 2026-11-16 13:40 UTC (permalink / raw)
To: no-reply, khorenko; +Cc: devel
On 11/16/26 15:13, no-reply@sashiko.virtuozzo.com wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] selftests/bpf: xsk bitmap fix lacks Fixes: trailers
> --
>
> commit ee0829e53ca566bede00c40365c639ece9f4e9bd
> Author: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
>
>> ms/selftests/bpf: test_xsk: Initialize bitmap before use
>>
>> bitmap is used before being initialized.
>>
>> Initialize it to zero before using it.
>>
>> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>> Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
>> Link: https://lore.kernel.org/r/20251031-xsk-v7-2-39fe486593a3@bootlin.com
>> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>> (cherry picked from commit 2233ef8bba81e02e8fee6300a81dcf389aa17c58)
>>
>> Rebase note: applied to xskxceiver.c. Mainline moved this code to
>> test_xsk.c in commit 3ab77f35a75e ("selftests/bpf: test_xsk: Split
>> xskxceiver"), which is not here. The code is the same.
>>
>> https://virtuozzo.atlassian.net/browse/VSTOR-154851
>> Feature: fix selftests
>>
>> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> [Severity: Low]
> This fixes reads of an uninitialized on-stack bitmap in receive_pkts() and
> send_pkts(), but the message has no Fixes: tags. Should it include the
> commits that introduced the two bugs?
>
> Fixes: 8913e653e9b8 ("selftests/xsk: Iterate over all the sockets in the receive pkts function")
> Fixes: fd0815ae9b8a ("selftests/xsk: Iterate over all the sockets in the send pkts function")
It would indeed be nice, but the original mainline commit lacks such
tag. I have decided not to make up a tag for it, and keep as-is.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Devel] [PATCH hci-8.1 2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet
2026-11-16 13:07 [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Eva Kurchatova
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use Eva Kurchatova
@ 2026-11-16 13:07 ` Eva Kurchatova
2026-11-16 13:13 ` no-reply
2026-11-16 17:00 ` [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Konstantin Khorenko
2026-11-16 17:00 ` Konstantin Khorenko
3 siblings, 1 reply; 8+ messages in thread
From: Eva Kurchatova @ 2026-11-16 13:07 UTC (permalink / raw)
To: khorenko; +Cc: devel
From: Larysa Zaremba <larysa.zaremba@intel.com>
The issue occurs in TOO_MANY_FRAGS test case when xdp_zc_max_segs is set to
an odd number.
TOO_MANY_FRAGS test case contains an invalid packet consisting of
(xdp_zc_max_segs) frags. Every frag, even the last one has XDP_PKT_CONTD
flag set. This packet is expected to be dropped. After that, there is a
valid linear packet, which is expected to be received back.
Once (xdp_zc_max_segs) is an odd number, the last packet cannot be
received, if packet forwarding between Rx and Tx interfaces relies on
the ethernet header, e.g. checks for ETH_P_LOOPBACK. Packet is malformed,
if all traffic is looped.
Turns out, sending function processes multiple invalid frags as if they
were in 2-frag packets. So once the invalid mbuf packet contains an odd
number of those, the valid packet after gets paired with the previous
invalid descriptor, and hence does not get an ethernet header generated, so
it is either dropped or malformed.
Make invalid packets in verbatim mode always have only a single frag. For
such packets, number of frags is otherwise meaningless, as descriptor flags
are pre-configured in verbatim mode and packet data is not generated for
invalid descriptors.
Fixes: 697604492b64 ("selftests/xsk: add invalid descriptor test for multi-buffer")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://lore.kernel.org/r/20260203155103.2305816-3-larysa.zaremba@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
(cherry picked from commit 88af9fefed412e4bea9a1a771cbe6fe347fa3507)
Rebase note: applied to xskxceiver.c. Mainline moved this code to
test_xsk.c in commit 3ab77f35a75e ("selftests/bpf: test_xsk: Split
xskxceiver") and then to prog_tests/ in commit d1aec26fce25
("selftests/bpf: test_xsk: Integrate test_xsk.c to test_progs
framework"). Neither is here. The code is the same.
https://virtuozzo.atlassian.net/browse/VSTOR-154852
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
tools/testing/selftests/bpf/xskxceiver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 014b20ef4aaf..5707c8d520ef 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -724,7 +724,7 @@ static u32 pkt_nb_frags(u32 frame_size, struct pkt_stream *pkt_stream, struct pk
}
/* Search for the end of the packet in verbatim mode */
- if (!pkt_continues(pkt->options))
+ if (!pkt_continues(pkt->options) || !pkt->valid)
return nb_frags;
next_frag = pkt_stream->current_pkt_nb;
--
2.56.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes
2026-11-16 13:07 [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Eva Kurchatova
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use Eva Kurchatova
2026-11-16 13:07 ` [Devel] [PATCH hci-8.1 2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet Eva Kurchatova
@ 2026-11-16 17:00 ` Konstantin Khorenko
2026-11-16 17:00 ` Konstantin Khorenko
3 siblings, 0 replies; 8+ messages in thread
From: Konstantin Khorenko @ 2026-11-16 17:00 UTC (permalink / raw)
To: Eva Kurchatova; +Cc: devel
Applying as is.
On Mon, 16 Nov 2026 15:07:31 +0200, Eva Kurchatova <eva.kurchatova@virtuozzo.com> wrote:
> Bastien Curutchet (eBPF Foundation) (1):
> ms/selftests/bpf: test_xsk: Initialize bitmap before use
>
> Larysa Zaremba (1):
> ms/selftests/xsk: fix number of Tx frags in invalid packet
Both hunks are the same as mainline, and keeping the upstream message
without a Fixes: tag is right for an ms/ cherry-pick.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes
2026-11-16 13:07 [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Eva Kurchatova
` (2 preceding siblings ...)
2026-11-16 17:00 ` [Devel] [PATCH hci-8.1 0/2] ms/selftests: backport xsk fixes Konstantin Khorenko
@ 2026-11-16 17:00 ` Konstantin Khorenko
3 siblings, 0 replies; 8+ messages in thread
From: Konstantin Khorenko @ 2026-11-16 17:00 UTC (permalink / raw)
To: Eva Kurchatova; +Cc: devel
On Mon, 16 Nov 2026 15:07:31 +0200, Eva Kurchatova wrote:
> ms/selftests: backport xsk fixes
>
> Patchset for tasks:
> - https://virtuozzo.atlassian.net/browse/VSTOR-154851
> - https://virtuozzo.atlassian.net/browse/VSTOR-154852
>
> Rebased backports from mainline only.
>
> [...]
Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.24.3.vz10, thanks!
[1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e4747e909fc6
[2/2] ms/selftests/xsk: fix number of Tx frags in invalid packet
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e063de22ef29
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 8+ messages in thread