Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754576AbbK3ON4 (ORCPT ); Mon, 30 Nov 2015 09:13:56 -0500 Received: from www62.your-server.de ([213.133.104.62]:49526 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754272AbbK3ONx (ORCPT ); Mon, 30 Nov 2015 09:13:53 -0500 Message-ID: <565C599B.1020902@iogearbox.net> Date: Mon, 30 Nov 2015 15:13:47 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Vyukov , syzkaller CC: Alexei Starovoitov , David Miller , Alexei Starovoitov , netdev , LKML , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin Subject: Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow References: <20151130005934.GA95228@ast-mbp.thefacebook.com> <565C549C.5080408@iogearbox.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 799 Lines: 24 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 -- 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/