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: <fe0e300f-a857-dc42-f9f8-c524be6b212f@iogearbox.net>
Date:   Tue, 1 Nov 2022 16:46:20 +0100
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Rong Tao <rtoax@...mail.com>
Cc:     andrii.nakryiko@...il.com, andrii@...nel.org, ast@...nel.org,
        bpf@...r.kernel.org, david.laight@...lab.com, haoluo@...gle.com,
        john.fastabend@...il.com, jolsa@...nel.org, kpsingh@...nel.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        martin.lau@...ux.dev, mykolal@...com, rongtao@...tc.cn,
        sdf@...gle.com, shuah@...nel.org, song@...nel.org, yhs@...com
Subject: Re: [PATCH bpf-next] selftests/bpf: Fix strncpy() fortify warning

On 11/1/22 3:23 PM, Rong Tao wrote:
> From: Rong Tao <rongtao@...tc.cn>
> 
> move libbpf_strlcpy() to bpf_util.h, and replace strncpy() with
> libbpf_strlcpy(), fix compile warning.
> 
> Compile samples/bpf, warning:
> $ cd samples/bpf
> $ make
> ...
> cgroup_helpers.c: In function ‘__enable_controllers’:
> cgroup_helpers.c:80:17: warning: ‘strncpy’ specified bound 4097 equals destination size [-Wstringop-truncation]
>     80 |                 strncpy(enable, controllers, sizeof(enable));
>        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Rong Tao <rongtao@...tc.cn>

Nope, BPF CI fails once again with:

https://github.com/kernel-patches/bpf/actions/runs/3370230622/jobs/5590876906

   [...]
     TEST-OBJ [test_progs-no_alu32] connect_ping.test.o
     TEST-OBJ [test_progs-no_alu32] map_kptr.test.o
   In file included from /tmp/work/bpf/bpf/tools/testing/selftests/bpf/prog_tests/perf_branches.c:7:
   /tmp/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf_internal.h:200:20: error: redefinition of 'libbpf_strlcpy'
   static inline void libbpf_strlcpy(char *dst, const char *src, size_t sz)
                      ^
   /tmp/work/bpf/bpf/tools/testing/selftests/bpf/bpf_util.h:29:20: note: previous definition is here
   static inline void libbpf_strlcpy(char *dst, const char *src, size_t sz)
                      ^
   1 error generated.
     TEST-OBJ [test_progs-no_alu32] hash_large_key.test.o
   make: *** [Makefile:539: /tmp/work/bpf/bpf/tools/testing/selftests/bpf/no_alu32/perf_branches.test.o] Error 1
   make: *** Waiting for unfinished jobs....
   make: Leaving directory '/tmp/work/bpf/bpf/tools/testing/selftests/bpf'
   Error: Process completed with exit code 2.

Please do not send broken stuff that was not even compile tested.

Here's a small howto for running BPF selftests:

https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/README.rst#n48

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ