2017-11-02 22:44:27

by Daniel Borkmann

[permalink] [raw]
Subject: Re: [PATCH 2/2] [net-next] bpf: fix out-of-bounds access warning in bpf_check

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 <[email protected]>

Acked-by: Daniel Borkmann <[email protected]>

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