]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: bpf: double check vNIC capabilities after object sharing
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 16 Oct 2018 22:19:10 +0000 (15:19 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 16 Oct 2018 22:23:58 +0000 (15:23 -0700)
commit018b1d1e1d8adb7f8165bde1d5cd89a4a1b9b1ac
tree84a63bce9d9e3affca45063d33dba59d3deb3ecc
parenta33b9708e7816ca212215a5c7194344fbacc9be7
nfp: bpf: double check vNIC capabilities after object sharing

Program translation stage checks that program can be offloaded to
the netdev which was passed during the load (bpf_attr->prog_ifindex).
After program sharing was introduced, however, the netdev on which
program is loaded can theoretically be different, and therefore
we should recheck the program size and max stack size at load time.

This was found by code inspection, AFAIK today all vNICs have
identical caps.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c
drivers/net/ethernet/netronome/nfp/bpf/verifier.c