Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755319AbbK3Xak (ORCPT ); Mon, 30 Nov 2015 18:30:40 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35793 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbbK3Xai (ORCPT ); Mon, 30 Nov 2015 18:30:38 -0500 Date: Mon, 30 Nov 2015 15:30:34 -0800 From: Alexei Starovoitov To: Daniel Borkmann Cc: davem@davemloft.net, Alexei Starovoitov , netdev , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Sasha Levin Subject: Re: [PATCH net] bpf: fix allocation warnings in bpf maps and integer overflow Message-ID: <20151130233033.GA67392@ast-mbp.thefacebook.com> References: <20151130005934.GA95228@ast-mbp.thefacebook.com> <565C549C.5080408@iogearbox.net> <565C5E7B.2080602@iogearbox.net> <20151130181310.GA30762@ast-mbp.thefacebook.com> <565CCACE.8020406@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565CCACE.8020406@iogearbox.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 22 On Mon, Nov 30, 2015 at 11:16:46PM +0100, Daniel Borkmann wrote: > > So, when creating a sufficiently large map where map->key_size + map->value_size > would be > MAX_BPF_STACK (but map->key_size still <= MAX_BPF_STACK), we can only > read the map from an eBPF program, but not update it. In such cases, updates could > only happen from user space application. yes and no. If both key_size + value_size > MAX_BPF_STACK, the program cannot technically call bpf_map_update_elem() helper, but the user space can still populate large map elements and the program can update it, since it can have a pointer via bpf_map_lookup_elem(). So depends on definition of 'update'. btw, the large-ish key support is actually needed too, since on tracing side we need to be able to do map[kernel_stack_and_user_stack]++ and key is multipage long. On userspace side it will be consumed by flamegraphs. -- 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/