]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix bpf_xdp_pointer return pointer
authorJoanne Koong <joannelkoong@gmail.com>
Fri, 22 Jul 2022 22:01:05 +0000 (15:01 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 26 Jul 2022 11:15:33 +0000 (13:15 +0200)
commitf634f3dff8d8516272b774d7dd8cdd25ea89da42
treec1e7dbbf8cad8597dbcef6cd9533969c5b28ab80
parent2499d7e7b29d7754cae83af7b7fd6ecdd3e1e8ea
bpf: Fix bpf_xdp_pointer return pointer

For the case where offset + len == size, bpf_xdp_pointer should return a
valid pointer to the addr because that access is permitted. We should
only return NULL in the case where offset + len exceeds size.

Fixes: 5c70129d8cf9 ("net: xdp: introduce bpf_xdp_pointer utility routine")
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/bpf/20220722220105.2065466-1-joannelkoong@gmail.com
net/core/filter.c