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] [day] [month] [year] [list]
Date:   Tue, 21 May 2019 16:56:34 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Matteo Croce <mcroce@...hat.com>, xdp-newbies@...r.kernel.org,
        bpf@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        Alexei Starovoitov <ast@...nel.org>
Subject: Re: [PATCH bpf] samples/bpf: suppress compiler warning

On 05/20/2019 11:49 PM, Matteo Croce wrote:
> GCC 9 fails to calculate the size of local constant strings and produces a
> false positive:
> 
> samples/bpf/task_fd_query_user.c: In function ‘test_debug_fs_uprobe’:
> samples/bpf/task_fd_query_user.c:242:67: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 215 [-Wformat-truncation=]
>   242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
>       |                                                                   ^~
>   243 |    event_type, event_alias);
>       |                ~~~~~~~~~~~
> samples/bpf/task_fd_query_user.c:242:2: note: ‘snprintf’ output between 45 and 300 bytes into a destination of size 256
>   242 |  snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   243 |    event_type, event_alias);
>       |    ~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Workaround this by lowering the buffer size to a reasonable value.
> Related GCC Bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83431
> 
> Signed-off-by: Matteo Croce <mcroce@...hat.com>

Applied, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ