[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20171022.005441.760530707225820143.davem@davemloft.net>
Date: Sun, 22 Oct 2017 00:54:41 +0100 (WEST)
From: David Miller <davem@...emloft.net>
To: john.r.fastabend@...il.com
Cc: richard@....at, alexei.starovoitov@...il.com,
netdev@...r.kernel.org, borkmann@...earbox.net
Subject: Re: [net PATCH] bpf: devmap fix arithmetic overflow in bitmap_size
calculation
From: John Fastabend <john.r.fastabend@...il.com>
Date: Thu, 19 Oct 2017 09:03:52 -0700
> 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>
Applied.
Powered by blists - more mailing lists