Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754632AbbK3OQv (ORCPT ); Mon, 30 Nov 2015 09:16:51 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:33756 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754325AbbK3OQs (ORCPT ); Mon, 30 Nov 2015 09:16:48 -0500 MIME-Version: 1.0 In-Reply-To: <565C599B.1020902@iogearbox.net> References: <20151130005934.GA95228@ast-mbp.thefacebook.com> <565C549C.5080408@iogearbox.net> <565C599B.1020902@iogearbox.net> From: Dmitry Vyukov Date: Mon, 30 Nov 2015 15:16:27 +0100 Message-ID: Subject: Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow To: Daniel Borkmann Cc: syzkaller , Alexei Starovoitov , David Miller , Alexei Starovoitov , netdev , LKML , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 931 Lines: 29 On Mon, Nov 30, 2015 at 3:13 PM, Daniel Borkmann 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/