Received: by 10.223.164.221 with SMTP id h29csp2688765wrb; Thu, 2 Nov 2017 15:44:27 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TBdqLuem+wboWM1HGdSQ7GUM08oGOTIhNE3ELgv0Fp/dR1B3TL/qye6Igu0iYKdlFBTWUj X-Received: by 10.159.253.9 with SMTP id p9mr4773745pls.344.1509662667563; Thu, 02 Nov 2017 15:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509662667; cv=none; d=google.com; s=arc-20160816; b=e06G384Vqigp9QdArGAB+eCn64uC8xKLGl2MxRHglslCkWZFbHBp/ftkH/cHlGXzLn 0ONrP4HxUKFZOWjHy0LHG1E/CuQJ1tSuhw+Iwylif0iDFWiF28rZY/sHH94tPsLG7rra rtlU2epnBbBqwU/TSgfUCIsPhUiOQJ6MB0N0ESVIDD8fjWsQIeUN+pJ5NAvzqHGyX+V7 0mmHTl1sDeiMItL4lPh7spCZk9RVphoEES8rgjnaVox5ur8V/nKFLhpa/vu2wI3F7cSI smNwmdNDeD/4fN+qh04ooysCMbkpqmu7Wj8/ZfWxg9V3GziI+s9iYDybZNaI6qiqC7Zy iD9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=zAeCcS8IfO0YYkJOMASy50Vqn9LvEmNAbuGhpLFT6Ek=; b=G1Csodq118mHxPlKB6KNzMb/NZnWwzTmWROygCZY7uSYIFRnu64lJj0MsP28It7LaA jLcHX7tFwMjmXlflmE2Q7B8ZkQ9GuVH2pQ2bfOmr9xTjOd9EoBvj2m2iQFNRzgZfpJGp Uhf+vw3xXmYS913EaAcTCxZNLQBXMu3fZQyicfOlKQNqWfA1fYKO9o20gBGPHWc33Wn0 aoo9HrickMhyWR4Gy0ockphtqMxUhSWONdngxoVlbJ6KQ1wc/wEkf7m6QYILFG1e79vV ctLzBdP/HeQPiO/GIiUPuiPBDbITKxJzpTYjs73X3/EpfPRUPDUi8R8xJf+UfPg74o+z b21w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si4652718pgn.363.2017.11.02.15.44.14; Thu, 02 Nov 2017 15:44:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934650AbdKBWfb (ORCPT + 99 others); Thu, 2 Nov 2017 18:35:31 -0400 Received: from www62.your-server.de ([213.133.104.62]:38819 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbdKBWfa (ORCPT ); Thu, 2 Nov 2017 18:35:30 -0400 Received: from [194.230.159.142] (helo=localhost.localdomain) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1eAO56-0002ev-4Q; Thu, 02 Nov 2017 23:35:24 +0100 Message-ID: <59FB9DAA.702@iogearbox.net> Date: Thu, 02 Nov 2017 23:35:22 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Arnd Bergmann , Alexei Starovoitov CC: "David S. Miller" , Edward Cree , John Fastabend , Jakub Kicinski , 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 References: <20171102110558.2746221-1-arnd@arndb.de> <20171102110558.2746221-2-arnd@arndb.de> In-Reply-To: <20171102110558.2746221-2-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.2/24010/Thu Nov 2 13:07:00 2017) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/2017 12:05 PM, Arnd Bergmann wrote: > 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 Acked-by: Daniel Borkmann LGTM, and bpf_analyzer() already has proper logic to bail out for such cases (although only used by nfp right now, which is there when NET is configured anyway). From 1582981168404746734@xxx Thu Nov 02 18:48:03 +0000 2017 X-GM-THRID: 1582952280708618442 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread