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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <857a9d504cccaf046d869c34a85e970513a403af.camel@gmail.com>
Date: Mon, 03 Feb 2025 21:58:16 -0800
From: Eduard Zingerman <eddyz87@...il.com>
To: Amery Hung <ameryhung@...il.com>, netdev@...r.kernel.org
Cc: bpf@...r.kernel.org, daniel@...earbox.net, andrii@...nel.org, 
	alexei.starovoitov@...il.com, martin.lau@...nel.org, kuba@...nel.org, 
	edumazet@...gle.com, xiyou.wangcong@...il.com, cong.wang@...edance.com, 
	jhs@...atatu.com, sinquersw@...il.com, toke@...hat.com, jiri@...nulli.us, 
	stfomichev@...il.com, ekarani.silvestre@....ufcg.edu.br,
 yangpeihao@...u.edu.cn, 	yepeilin.cs@...il.com, ming.lei@...hat.com,
 kernel-team@...a.com
Subject: Re: [PATCH bpf-next v3 18/18] selftests/bpf: Test attaching bpf
 qdisc to mq and non root

On Fri, 2025-01-31 at 11:28 -0800, Amery Hung wrote:

[...]

> diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c b/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c
> index 7e8e3170e6b6..f3158170edff 100644
> --- a/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c
> +++ b/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c
> @@ -86,18 +86,125 @@ static void test_fq(void)
>  	bpf_qdisc_fq__destroy(fq_skel);
>  }
>  
> +static int netdevsim_write_cmd(const char *path, const char *cmd)
> +{
> +	FILE *fp;
> +
> +	fp = fopen(path, "w");
> +	if (!ASSERT_OK_PTR(fp, "write_netdevsim_cmd"))
> +		return -errno;
> +
> +	fprintf(fp, cmd);

I get the following error message when compiling these tests using
clang 19.1.7:

<kernel>/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c:97:14: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
   97 |         fprintf(fp, cmd);
      |                     ^~~
<kernel>/tools/testing/selftests/bpf/prog_tests/bpf_qdisc.c:97:14: note: treat the string as an argument to avoid this
   97 |         fprintf(fp, cmd);
      |                     ^
      |   

> +	fclose(fp);
> +	return 0;
> +}
> +

[...]


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ