[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMB2axPYaEMkv8W9MWNTYsr=+1w9xUUs6FUcW6zJDMyg=giJ7g@mail.gmail.com>
Date: Tue, 4 Feb 2025 10:17:31 -0800
From: Amery Hung <ameryhung@...il.com>
To: Eduard Zingerman <eddyz87@...il.com>
Cc: netdev@...r.kernel.org, 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 Mon, Feb 3, 2025 at 9:58 PM Eduard Zingerman <eddyz87@...il.com> wrote:
>
> 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);
> | ^
> |
>
I am removing the use of netdevsim and along with this function in the
next version. The warning should also disappear. Thanks for the
review!
> > + fclose(fp);
> > + return 0;
> > +}
> > +
>
> [...]
>
Powered by blists - more mailing lists