From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow Date: Mon, 30 Nov 2015 15:13:47 +0100 Message-ID: <565C599B.1020902@iogearbox.net> References: <20151130005934.GA95228@ast-mbp.thefacebook.com> <565C549C.5080408@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexei Starovoitov , David Miller , Alexei Starovoitov , netdev , LKML , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin To: Dmitry Vyukov , syzkaller Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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. Thanks, Daniel