All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Connor O'Brien <connoro@google.com>
Cc: stable@vger.kernel.org, Bui Quang Minh <minhquangbui99@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>
Subject: Re: [PATCH] bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc
Date: Wed, 15 Dec 2021 14:34:27 +0100	[thread overview]
Message-ID: <Ybnu4weOY6yMK/pD@kroah.com> (raw)
In-Reply-To: <20211215020139.126521-1-connoro@google.com>

On Wed, Dec 15, 2021 at 02:01:39AM +0000, Connor O'Brien wrote:
> From: Bui Quang Minh <minhquangbui99@gmail.com>
> 
> commit 7dd5d437c258bbf4cc15b35229e5208b87b8b4e0 upstream.
> 
> In 32-bit architecture, the result of sizeof() is a 32-bit integer so
> the expression becomes the multiplication between 2 32-bit integer which
> can potentially leads to integer overflow. As a result,
> bpf_map_area_alloc() allocates less memory than needed.
> 
> Fix this by casting 1 operand to u64.
> 
> Fixes: 0d2c4f964050 ("bpf: Eliminate rlimit-based memory accounting for sockmap and sockhash maps")
> Fixes: 99c51064fb06 ("devmap: Use bpf_map_area_alloc() for allocating hash buckets")
> Fixes: 546ac1ffb70d ("bpf: add devmap, a map for storing net device references")
> Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> Link: https://lore.kernel.org/bpf/20210613143440.71975-1-minhquangbui99@gmail.com
> Signed-off-by: Connor O'Brien <connoro@google.com>
> ---
> Hello,
> 
> This is for the 5.4 and 5.10 kernels.

Now queued up, thanks.

greg k-h

  reply	other threads:[~2021-12-15 13:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  2:01 [PATCH] bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc Connor O'Brien
2021-12-15 13:34 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-26  8:26 Bui Quang Minh
2021-01-26  9:36 ` Lorenz Bauer
2021-01-27  4:23   ` Bui Quang Minh
2021-01-27  5:09     ` Bui Quang Minh
2021-01-28  0:41     ` Daniel Borkmann
2021-05-17 15:10       ` Bui Quang Minh

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=Ybnu4weOY6yMK/pD@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=ast@kernel.org \
    --cc=connoro@google.com \
    --cc=minhquangbui99@gmail.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.