linux-stable/include
Daniel Borkmann dc0477ef4d netkit: Fix pkt_type override upon netkit pass verdict
[ Upstream commit 3998d18426 ]

When running Cilium connectivity test suite with netkit in L2 mode, we
found that compared to tcx a few tests were failing which pushed traffic
into an L7 proxy sitting in host namespace. The problem in particular is
around the invocation of eth_type_trans() in netkit.

In case of tcx, this is run before the tcx ingress is triggered inside
host namespace and thus if the BPF program uses the bpf_skb_change_type()
helper the newly set type is retained. However, in case of netkit, the
late eth_type_trans() invocation overrides the earlier decision from the
BPF program which eventually leads to the test failure.

Instead of eth_type_trans(), split out the relevant parts, meaning, reset
of mac header and call to eth_skb_pkt_type() before the BPF program is run
in order to have the same behavior as with tcx, and refactor a small helper
called eth_skb_pull_mac() which is run in case it's passed up the stack
where the mac header must be pulled. With this all connectivity tests pass.

Fixes: 35dfaad718 ("netkit, bpf: Add bpf programmable net device")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20240524163619.26001-2-daniel@iogearbox.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:39:48 +02:00
..
acpi
asm-generic
clocksource
crypto
drm drm/edid: Parse topology block for all DispID structure v1.x 2024-05-30 09:44:52 +02:00
dt-bindings
keys
kunit
kvm
linux netkit: Fix pkt_type override upon netkit pass verdict 2024-06-12 11:39:48 +02:00
math-emu
media media: cec: core: avoid recursive cec_claim_log_addrs 2024-06-12 11:39:33 +02:00
memory
misc
net Bluetooth: ISO: Handle PA sync when no BIGInfo reports are generated 2024-06-12 11:39:36 +02:00
pcmcia
ras
rdma
rv
scsi
soc
sound ASoC: tas2781: Fix wrong loading calibrated data sequence 2024-06-12 11:39:39 +02:00
target
trace ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value 2024-05-30 09:44:49 +02:00
uapi drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations 2024-06-12 11:39:36 +02:00
ufs
vdso
video
xen