lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e273b1f1-868f-440e-b226-84b493ef7ee2@iogearbox.net>
Date: Wed, 15 Jan 2025 15:56:40 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Song Yoong Siang <yoong.siang.song@...el.com>,
 "David S . Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
 Willem de Bruijn <willemb@...gle.com>,
 Florian Bezdeka <florian.bezdeka@...mens.com>,
 Donald Hunter <donald.hunter@...il.com>, Jonathan Corbet <corbet@....net>,
 Bjorn Topel <bjorn@...nel.org>, Magnus Karlsson <magnus.karlsson@...el.com>,
 Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
 Jonathan Lemon <jonathan.lemon@...il.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, Alexei Starovoitov <ast@...nel.org>,
 Jesper Dangaard Brouer <hawk@...nel.org>,
 John Fastabend <john.fastabend@...il.com>, Joe Damato <jdamato@...tly.com>,
 Stanislav Fomichev <sdf@...ichev.me>, Xuan Zhuo
 <xuanzhuo@...ux.alibaba.com>, Mina Almasry <almasrymina@...gle.com>,
 Daniel Jurgens <danielj@...dia.com>, Andrii Nakryiko <andrii@...nel.org>,
 Eduard Zingerman <eddyz87@...il.com>, Mykola Lysenko <mykolal@...com>,
 Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
 Yonghong Song <yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>,
 Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
 Shuah Khan <shuah@...nel.org>,
 Alexandre Torgue <alexandre.torgue@...s.st.com>,
 Jose Abreu <joabreu@...opsys.com>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>,
 Tony Nguyen <anthony.l.nguyen@...el.com>,
 Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-doc@...r.kernel.org, bpf@...r.kernel.org,
 linux-kselftest@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
 linux-arm-kernel@...ts.infradead.org, intel-wired-lan@...ts.osuosl.org,
 xdp-hints@...-project.net
Subject: Re: [PATCH bpf-next v5 2/4] selftests/bpf: Add launch time request to
 xdp_hw_metadata

On 1/14/25 4:27 PM, Song Yoong Siang wrote:
[...]
> +	/* Add mqprio qdisc with TC and hardware queue one-to-one mapping */
> +	char map[256] = {0};
> +	char queues[256] = {0};
> +
> +	for (i = 0; i < rxq; i++) {
> +		char buf[8];
> +
> +		snprintf(buf, sizeof(buf), "%d ", i);
> +		strcat(map, buf);
> +
> +		snprintf(buf, sizeof(buf), "1@%d ", i);
> +		strcat(queues, buf);
> +	}
> +	run_command("sudo tc qdisc add dev %s handle 8001: parent root mqprio num_tc %d map %s queues %s hw 0",
> +		    ifname, rxq, map, queues);

Fyi, above triggers selftest build errors:

   xdp_hw_metadata.c: In function ‘main’:
   xdp_hw_metadata.c:763:45: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Werror=format-truncation=]
     763 |                 snprintf(buf, sizeof(buf), "%d ", i);
         |                                             ^~
     TEST-OBJ [test_progs] arg_parsing.test.o
   xdp_hw_metadata.c:763:44: note: directive argument in the range [0, 2147483646]
     763 |                 snprintf(buf, sizeof(buf), "%d ", i);
         |                                            ^~~~~
   xdp_hw_metadata.c:763:17: note: ‘snprintf’ output between 3 and 12 bytes into a destination of size 8
     763 |                 snprintf(buf, sizeof(buf), "%d ", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   xdp_hw_metadata.c:766:47: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Werror=format-truncation=]
     766 |                 snprintf(buf, sizeof(buf), "1@%d ", i);
         |                                               ^~
   xdp_hw_metadata.c:766:44: note: directive argument in the range [0, 2147483646]
     766 |                 snprintf(buf, sizeof(buf), "1@%d ", i);
         |                                            ^~~~~~~
   xdp_hw_metadata.c:766:17: note: ‘snprintf’ output between 5 and 14 bytes into a destination of size 8
     766 |                 snprintf(buf, sizeof(buf), "1@%d ", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ