[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171019221245.a7grq3csbpixjgpn@ast-mbp>
Date: Thu, 19 Oct 2017 15:12:46 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: John Fastabend <john.r.fastabend@...il.com>
Cc: richard@....at, davem@...emloft.net, netdev@...r.kernel.org,
borkmann@...earbox.net
Subject: Re: [net PATCH] bpf: devmap fix arithmetic overflow in bitmap_size
calculation
On Thu, Oct 19, 2017 at 09:03:52AM -0700, John Fastabend wrote:
> An integer overflow is possible in dev_map_bitmap_size() when
> calculating the BITS_TO_LONG logic which becomes, after macro
> replacement,
>
> (((n) + (d) - 1)/ (d))
>
> where 'n' is a __u32 and 'd' is (8 * sizeof(long)). To avoid
> overflow cast to u64 before arithmetic.
>
> Reported-by: Richard Weinberger <richard@....at>
> Acked-by: Daniel Borkmann <daniel@...earbox.net>
> Signed-off-by: John Fastabend <john.fastabend@...il.com>
Acked-by: Alexei Starovoitov <ast@...nel.org>
Powered by blists - more mailing lists