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:   Wed, 18 Dec 2019 07:37:31 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Network Development <netdev@...r.kernel.org>,
        bpf <bpf@...r.kernel.org>,
        Naresh Kamboju <naresh.kamboju@...aro.org>
Subject: Re: [PATCH bpf-next] libbpf: Use PRIu64 when printing ulimit value

On Wed, Dec 18, 2019 at 3:28 AM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> Naresh pointed out that libbpf builds fail on 32-bit architectures because
> rlimit.rlim_cur is defined as 'unsigned long long' on those architectures.
> Fix this by using the PRIu64 definition in printf.
>
> Fixes: dc3a2d254782 ("libbpf: Print hint about ulimit when getting permission denied error")
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> ---
>  tools/lib/bpf/libbpf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 3fe42d6b0c2f..ba31083998ce 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -117,7 +117,7 @@ static void pr_perm_msg(int err)
>                 return;
>
>         if (limit.rlim_cur < 1024)
> -               snprintf(buf, sizeof(buf), "%lu bytes", limit.rlim_cur);
> +               snprintf(buf, sizeof(buf), "%"PRIu64" bytes", limit.rlim_cur);

please use %zu and (size_t) cast like the rest of libbpf.
Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ