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


Groups > linux.kernel > #1279929

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

From Dmitry Vyukov <dvyukov@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow
Date 2015-11-30 15:20 +0100
Message-ID <qAxta-4HX-63@gated-at.bofh.it> (permalink)
References <qAa3v-6CS-13@gated-at.bofh.it> <qAl8B-56u-3@gated-at.bofh.it> <qAx9M-4lF-9@gated-at.bofh.it> <qAx9M-4lF-11@gated-at.bofh.it> <qAxt8-4HX-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 30, 2015 at 3:13 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
> On 11/30/2015 02:57 PM, Dmitry Vyukov wrote:
> ...
>>
>> kamlloc produces a WARNING if you try to allocate more than it ever
>> possibly can (KMALLOC_SHIFT_MAX).
>
>
> Sure, I understand that.
>
> The kzalloc() in array_map_alloc() is however with __GFP_NOWARN flag
> already.
> The warning only triggers in mm if:
>
>   WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
>
> Your test case is using ca.map_type = 1, which is BPF_MAP_TYPE_HASH. So on
> update you're triggering the kmalloc() in htab_map_update_elem().
>
> I'm just asking about the added change in array map.


Then, sorry.
Let's wait for Alexei.
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

user-controllable kmalloc size in bpf syscall Dmitry Vyukov <dvyukov@google.com> - 2015-11-29 14:20 +0100
  Re: user-controllable kmalloc size in bpf syscall Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-11-29 19:30 +0100
  [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-11-30 02:10 +0100
    Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Daniel Borkmann <daniel@iogearbox.net> - 2015-11-30 15:00 +0100
      Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow Dmitry Vyukov <dvyukov@google.com> - 2015-11-30 15:00 +0100
        Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Daniel Borkmann <daniel@iogearbox.net> - 2015-11-30 15:20 +0100
          Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow Dmitry Vyukov <dvyukov@google.com> - 2015-11-30 15:20 +0100
      Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Daniel Borkmann <daniel@iogearbox.net> - 2015-11-30 15:40 +0100
        Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-11-30 19:20 +0100
          Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Daniel Borkmann <daniel@iogearbox.net> - 2015-11-30 23:20 +0100
            Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer  overflow Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-12-01 00:40 +0100
    Re: [PATCH net] bpf: fix allocation warnings in bpf maps and  integer overflow David Miller <davem@davemloft.net> - 2015-12-03 05:40 +0100

csiph-web