netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: john.r.fastabend@gmail.com
Cc: richard@nod.at, alexei.starovoitov@gmail.com,
	netdev@vger.kernel.org, borkmann@iogearbox.net
Subject: Re: [net PATCH] bpf: devmap fix arithmetic overflow in bitmap_size calculation
Date: Sun, 22 Oct 2017 00:54:41 +0100 (WEST)	[thread overview]
Message-ID: <20171022.005441.760530707225820143.davem@davemloft.net> (raw)
In-Reply-To: <150842903200.12537.10765604428561566031.stgit@john-XPS-13-9360>

From: John Fastabend <john.r.fastabend@gmail.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@nod.at>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>

Applied.

      parent reply	other threads:[~2017-10-21 23:54 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
2017-10-21 23:54 ` David Miller [this message]

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=20171022.005441.760530707225820143.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=borkmann@iogearbox.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;
as well as URLs for NNTP newsgroup(s).