OpenCloudOS-Kernel/net
Toke Høiland-Jørgensen b902278a4a bpf: Always return target ifindex in bpf_fib_lookup
commit d1c362e1dd upstream.

The bpf_fib_lookup() helper performs a neighbour lookup for the destination
IP and returns BPF_FIB_LKUP_NO_NEIGH if this fails, with the expectation
that the BPF program will pass the packet up the stack in this case.
However, with the addition of bpf_redirect_neigh() that can be used instead
to perform the neighbour lookup, at the cost of a bit of duplicated work.

For that we still need the target ifindex, and since bpf_fib_lookup()
already has that at the time it performs the neighbour lookup, there is
really no reason why it can't just return it in any case. So let's just
always return the ifindex if the FIB lookup itself succeeds.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Link: https://lore.kernel.org/bpf/20201009184234.134214-1-toke@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
2024-09-23 13:03:46 +08:00
..
6lowpan 6lowpan: no need to check return value of debugfs_create functions 2019-07-06 12:50:01 +02:00
9p xen/9p: use alloc/free_pages_exact() 2024-06-11 20:41:34 +08:00
802 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
8021q ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
appletalk ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
atm ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ax25 ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
batman-adv ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
bluetooth ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
bpf ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
bpfilter ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
bridge ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
caif net: use skb_queue_empty_lockless() in poll() handlers 2019-10-28 13:33:41 -07:00
can ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ceph ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
core bpf: Always return target ifindex in bpf_fib_lookup 2024-09-23 13:03:46 +08:00
dcb ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
dccp ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
decnet tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
dns_resolver ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
dsa ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ethernet tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
hsr ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ieee802154 ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ife net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
ipv4 net: tcp: add sysctl_tcp_wnd_shrink 2024-06-11 20:51:19 +08:00
ipv6 net/proc: added sockets details statistics 2024-06-11 20:41:14 +08:00
iucv ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
kcm kcm: disable preemption in kcm_parse_func_strparser() 2019-09-27 10:27:14 +02:00
key af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register 2024-06-11 20:44:35 +08:00
l2tp ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
l3mdev ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF 2019-06-23 13:24:17 -07:00
lapb ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
llc llc: fix netdevice reference leaks in llc_ui_bind() 2024-06-11 20:44:36 +08:00
mac80211 ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
mac802154 ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
mpls ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ncsi ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
netfilter netfilter: nf_tables: reject QUEUE/DROP verdict parameters 2024-06-11 20:52:46 +08:00
netlabel ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
netlink net/proc: added sockets details statistics 2024-06-11 20:41:14 +08:00
netrom ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
nfc Merge CVE-2021-3760 bugfix patch, and the source of the patch 2024-06-11 20:52:45 +08:00
nsh treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
openvswitch ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
packet ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
phonet phonet: refcount leak in pep_sock_accep 2024-06-11 20:44:37 +08:00
psample tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
qrtr ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
rds ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
rfkill ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
rose net: rose: fix UAF bugs caused by timer handler 2024-06-11 20:49:22 +08:00
rxrpc ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sched net: sched: fix use-after-free in tc_new_tfilter() 2024-06-11 20:44:35 +08:00
sctp sctp: use call_rcu to free endpoint 2024-06-11 20:44:37 +08:00
smc ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
strparser Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-22 08:59:24 -04:00
sunrpc SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() 2024-06-11 20:43:56 +08:00
switchdev ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
tipc tipc: improve size validations for received domain records 2024-06-11 20:44:35 +08:00
tls ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
toa ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
unix net/proc: added sockets details statistics 2024-06-11 20:41:14 +08:00
vmw_vsock ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
wimax wimax: no need to check return value of debugfs_create functions 2019-08-10 15:25:47 -07:00
wireless ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
x25 ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
xdp ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
xfrm xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup() 2024-06-11 20:49:23 +08:00
Kconfig tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
Makefile tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
compat.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
socket.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sysctl_net.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00