OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use
Date: Mon, 16 Nov 2026 15:07:32 +0200	[thread overview]
Message-ID: <20261116130936.612078-2-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261116130936.612078-1-eva.kurchatova@virtuozzo.com>

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

  reply	other threads:[~2026-11-16 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-11-16 13:13   ` [Devel] [PATCH hci-8.1 1/2] ms/selftests/bpf: test_xsk: Initialize bitmap before use no-reply
2026-11-16 13:40     ` Eva Kurchatova (Virtuozzo)
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 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116130936.612078-2-eva.kurchatova@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox