Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1282696 > unrolled thread

Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow

Started byDavid Miller <davem@davemloft.net>
First post2015-12-03 05:40 +0100
Last post2015-12-03 05:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH net] bpf: fix allocation warnings in bpf maps and  integer overflow David Miller <davem@davemloft.net> - 2015-12-03 05:40 +0100

#1282696 — Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow

FromDavid Miller <davem@davemloft.net>
Date2015-12-03 05:40 +0100
SubjectRe: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow
Message-ID<qBtQu-6V-3@gated-at.bofh.it>
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Date: Sun, 29 Nov 2015 16:59:35 -0800

> From: Alexei Starovoitov <ast@kernel.org>
> 
> For large map->value_size the user space can trigger memory allocation warnings like:
 ...
> To avoid never succeeding kmalloc with order >= MAX_ORDER check that
> elem->value_size and computed elem_size are within limits for both hash and
> array type maps.
> Also add __GFP_NOWARN to kmalloc(value_size | elem_size) to avoid OOM warnings.
> Note kmalloc(key_size) is highly unlikely to trigger OOM, since key_size <= 512,
> so keep those kmalloc-s as-is.
> 
> Large value_size can cause integer overflows in elem_size and map.pages
> formulas, so check for that as well.
> 
> Fixes: aaac3ba95e4c ("bpf: charge user for creation of BPF maps and programs")
> Reported-by: Dmitry Vyukov <dvyukov@google.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web