From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755313AbdKCFUx (ORCPT ); Fri, 3 Nov 2017 01:20:53 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:35204 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbdKCFUv (ORCPT ); Fri, 3 Nov 2017 01:20:51 -0400 Date: Fri, 03 Nov 2017 14:20:47 +0900 (KST) Message-Id: <20171103.142047.186502648211524647.davem@davemloft.net> To: arnd@arndb.de Cc: ast@kernel.org, daniel@iogearbox.net, ecree@solarflare.com, john.fastabend@gmail.com, jakub.kicinski@netronome.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] [net-next] bpf: fix out-of-bounds access warning in bpf_check From: David Miller In-Reply-To: <20171102110558.2746221-2-arnd@arndb.de> References: <20171102110558.2746221-1-arnd@arndb.de> <20171102110558.2746221-2-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 02 Nov 2017 22:20:51 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Thu, 2 Nov 2017 12:05:52 +0100 > The bpf_verifer_ops array is generated dynamically and may be > empty depending on configuration, which then causes an out > of bounds access: > > kernel/bpf/verifier.c: In function 'bpf_check': > kernel/bpf/verifier.c:4320:29: error: array subscript is above array bounds [-Werror=array-bounds] > > This adds a check to the start of the function as a workaround. > I would assume that the function is never called in that configuration, > so the warning is probably harmless. > > Fixes: 00176a34d9e2 ("bpf: remove the verifier ops from program structure") > Signed-off-by: Arnd Bergmann Applied.