On 1/19/21 8:05 PM, Mircea CIRJALIU - MELIU wrote:
I assume this was obtained by copy-paste. Signed-off-by: Mircea Cirjaliu <mcirjaliu@xxxxxxxxxxxxxxx>
Ugh, big yikes (!), thanks a lot for the fix, applied! I've added Fixes tag to f1a2e44a3aec ("bpf: add queue and stack maps"). I bet either noone has been using bpf_map_peek_elem() in practice (at least from BPF program side) or it was most of the time hidden behind 84430d4232c3 ("bpf, verifier: avoid retpoline for map push/pop/peek operation") as JIT is enabled in most cases.
--- kernel/bpf/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index bd8a3183d030..41ca280b1dc1 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -108,7 +108,7 @@ BPF_CALL_2(bpf_map_peek_elem, struct bpf_map *, map, void *, value) } const struct bpf_func_proto bpf_map_peek_elem_proto = { - .func = bpf_map_pop_elem, + .func = bpf_map_peek_elem, .gpl_only = false, .ret_type = RET_INTEGER, .arg1_type = ARG_CONST_MAP_PTR, -- 2.25.1