From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: John Fastabend <john.r.fastabend@gmail.com>
Cc: richard@nod.at, davem@davemloft.net, netdev@vger.kernel.org,
borkmann@iogearbox.net
Subject: Re: [net PATCH] bpf: devmap fix arithmetic overflow in bitmap_size calculation
Date: Thu, 19 Oct 2017 15:12:46 -0700 [thread overview]
Message-ID: <20171019221245.a7grq3csbpixjgpn@ast-mbp> (raw)
In-Reply-To: <150842903200.12537.10765604428561566031.stgit@john-XPS-13-9360>
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@nod.at>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
next prev parent reply other threads:[~2017-10-19 22:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 16:03 [net PATCH] bpf: devmap fix arithmetic overflow in bitmap_size calculation John Fastabend
2017-10-19 22:12 ` Alexei Starovoitov [this message]
2017-10-21 23:54 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171019221245.a7grq3csbpixjgpn@ast-mbp \
--to=alexei.starovoitov@gmail.com \
--cc=borkmann@iogearbox.net \
--cc=davem@davemloft.net \
--cc=john.r.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox