From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH bpf] nfp: bpf: allow zero-length capabilities Date: Wed, 9 May 2018 18:18:49 +0200 Message-ID: References: <20180509024241.24032-1-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: oss-drivers@netronome.com, netdev@vger.kernel.org To: Jakub Kicinski , alexei.starovoitov@gmail.com Return-path: Received: from www62.your-server.de ([213.133.104.62]:57019 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965130AbeEIQSv (ORCPT ); Wed, 9 May 2018 12:18:51 -0400 In-Reply-To: <20180509024241.24032-1-jakub.kicinski@netronome.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 05/09/2018 04:42 AM, Jakub Kicinski wrote: > Some BPF capabilities carry no value, they simply indicate feature > is present. Our capability parsing loop will exit early if last > capability is zero-length because it's looking for more than 8 bytes > of data (8B is our TLV header length). Allow the last capability to > be zero-length. > > This bug would lead to driver failing to probe with the following error > if the last capability FW advertises is zero-length: > > nfp: BPF capabilities left after parsing, parsed:92 total length:100 > nfp: invalid BPF capabilities at offset:92 > > Note the "parsed" and "length" values are 8 apart. > > No shipping FW runs into this issue, but we can't guarantee that will > remain the case. > > Fixes: 77a844ee650c ("nfp: bpf: prepare for parsing BPF FW capabilities") > Signed-off-by: Jakub Kicinski > Reviewed-by: Quentin Monnet Applied to bpf tree, thanks!