Skip to content

Commit 75da63b

Browse files
committed
Alexei Starovoitov says: ==================== bpf 2021-08-26 We've added 1 non-merge commit during the last 1 day(s): 1) Fix ringbuf helper function compatibility, from Daniel. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Fix ringbuf helper function compatibility ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 57f8178 + 5b029a3 commit 75da63b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/bpf/verifier.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5150,8 +5150,6 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env,
51505150
case BPF_MAP_TYPE_RINGBUF:
51515151
if (func_id != BPF_FUNC_ringbuf_output &&
51525152
func_id != BPF_FUNC_ringbuf_reserve &&
5153-
func_id != BPF_FUNC_ringbuf_submit &&
5154-
func_id != BPF_FUNC_ringbuf_discard &&
51555153
func_id != BPF_FUNC_ringbuf_query)
51565154
goto error;
51575155
break;
@@ -5260,6 +5258,12 @@ static int check_map_func_compatibility(struct bpf_verifier_env *env,
52605258
if (map->map_type != BPF_MAP_TYPE_PERF_EVENT_ARRAY)
52615259
goto error;
52625260
break;
5261+
case BPF_FUNC_ringbuf_output:
5262+
case BPF_FUNC_ringbuf_reserve:
5263+
case BPF_FUNC_ringbuf_query:
5264+
if (map->map_type != BPF_MAP_TYPE_RINGBUF)
5265+
goto error;
5266+
break;
52635267
case BPF_FUNC_get_stackid:
52645268
if (map->map_type != BPF_MAP_TYPE_STACK_TRACE)
52655269
goto error;

0 commit comments

Comments
 (0)