]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: generalise tail call map compatibility check
authorToke Hoiland-Jorgensen <toke@redhat.com>
Fri, 21 Jan 2022 10:10:02 +0000 (11:10 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 21 Jan 2022 22:14:03 +0000 (14:14 -0800)
commitd27bdcbafbe26e7ad2d78ce83f5be807eee0e648
treeed4902ab21d3d6389bb0327279efc6e684ce4032
parent00aa1cbbd459e19b2b49f02617d7da2dca084974
bpf: generalise tail call map compatibility check

The check for tail call map compatibility ensures that tail calls only
happen between maps of the same type. To ensure backwards compatibility for
XDP frags we need a similar type of check for cpumap and devmap
programs, so move the state from bpf_array_aux into bpf_map, add
xdp_has_frags to the check, and apply the same check to cpumap and devmap.

Acked-by: John Fastabend <john.fastabend@gmail.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Toke Hoiland-Jorgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/f19fd97c0328a39927f3ad03e1ca6b43fd53cdfd.1642758637.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/arraymap.c
kernel/bpf/core.c
kernel/bpf/cpumap.c
kernel/bpf/devmap.c
kernel/bpf/syscall.c