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]
Date:   Sun, 22 Jan 2017 14:51:25 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Arnaldo Carvalho de Melo <acme@...hat.com>,
        Thomas Graf <tgraf@...g.ch>,
        Alexei Starovoitov <ast@...nel.org>,
        Joe Stringer <joe@....org>,
        "David S. Miller" <davem@...emloft.net>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [patch] samples/bpf: silence shift wrapping warning

On Sat, Jan 21, 2017 at 07:51:43AM +0300, Dan Carpenter wrote:
> max_key is a value in the 0-63 range, so on 32 bit systems the shift
> could wrap.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

Looks fine. I think 'net-next' is ok.

Acked-by: Alexei Starovoitov <ast@...nel.org>

> diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
> index ec8f3bb..bd06eef 100644
> --- a/samples/bpf/lwt_len_hist_user.c
> +++ b/samples/bpf/lwt_len_hist_user.c
> @@ -68,7 +68,7 @@ int main(int argc, char **argv)
>  	for (i = 1; i <= max_key + 1; i++) {
>  		stars(starstr, data[i - 1], max_value, MAX_STARS);
>  		printf("%8ld -> %-8ld : %-8ld |%-*s|\n",
> -		       (1l << i) >> 1, (1l << i) - 1, data[i - 1],
> +		       (1ULL << i) >> 1, (1ULL << i) - 1, data[i - 1],
>  		       MAX_STARS, starstr);
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ