linux/drivers
Daniel Borkmann 3998d18426 netkit: Fix pkt_type override upon netkit pass verdict
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>
2024-05-25 10:48:57 -07:00
..
accel
accessibility
acpi platform-drivers-x86 for v6.10-1 2024-05-16 09:14:50 -07:00
amba
android
ata SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
atm atm/fore200e: Delete unused 'fore200e_boards' 2024-05-06 18:26:47 -07:00
auxdisplay
base powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
bcma
block for-6.10/block-20240511 2024-05-13 13:03:54 -07:00
bluetooth MMC core: 2024-05-16 08:56:49 -07:00
bus Networking changes for 6.10. 2024-05-14 19:42:24 -07:00
cache
cdrom
cdx
char ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
clk ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
clocksource clocksource/drivers/arm_arch_timer: Mark hisi_161010101_oem_info const 2024-05-10 10:43:21 +02:00
comedi
connector
counter
cpufreq powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
cpuidle pmdomain core: 2024-05-16 08:50:32 -07:00
crypto Networking changes for 6.10. 2024-05-14 19:42:24 -07:00
cxl CXL changes for v6.10 merge window 2024-05-15 14:32:27 -07:00
dax Updates for nvdimm for 6.10 2024-05-15 14:28:56 -07:00
dca
devfreq PM / devfreq: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions 2024-05-09 00:30:37 +09:00
dio
dma ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
dma-buf
dpll dpll: fix return value check for kmemdup 2024-05-13 16:53:53 -07:00
edac - Have skx_edac decode error addresses belonging to SGX properly 2024-05-14 08:31:10 -07:00
eisa alpha: remove DECpc AXP150 (Jensen) support 2024-05-03 22:09:50 +02:00
extcon
firewire firewire updates for v6.10 2024-05-14 18:57:22 -07:00
firmware sound updates for 6.10-rc1 2024-05-15 10:02:36 -07:00
fpga
fsi
gnss
gpio gpio updates for v6.10-rc1 2024-05-14 15:07:07 -07:00
gpu drm urgent for 6.10-rc1 merge: 2024-05-16 08:44:19 -07:00
greybus
hid Merge branch 'for-6.10/winwing' into for-linus 2024-05-14 13:58:46 +02:00
hsi
hte
hv
hwmon pwm: Changes for v6.10-rc1 2024-05-14 15:03:19 -07:00
hwspinlock
hwtracing
i2c ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
i3c
idle
iio regulator: Updates for v6.10 2024-05-14 14:36:09 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-05-09 10:01:01 -07:00
input ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
interconnect
iommu X86 interrupt handling update: 2024-05-14 10:01:29 -07:00
ipack
irqchip Updates for the interrupt subsystem: 2024-05-14 09:47:14 -07:00
isdn
leds
macintosh powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
mailbox
mcb
md Networking changes for 6.10. 2024-05-14 19:42:24 -07:00
media media updates for v6.10-rc1 2024-05-16 08:45:44 -07:00
memory ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
memstick
message SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
mfd
misc hardening updates for 6.10-rc1 2024-05-13 14:14:05 -07:00
mmc MMC core: 2024-05-16 08:56:49 -07:00
most
mtd * MTD 2024-05-16 09:04:52 -07:00
mux
net netkit: Fix pkt_type override upon netkit pass verdict 2024-05-25 10:48:57 -07:00
nfc
ntb
nubus
nvdimm
nvme for-6.10/block-20240511 2024-05-13 13:03:54 -07:00
nvmem
of Devicetree for v6.10: 2024-05-17 17:27:49 -07:00
opp
parisc
parport
pci pci-v6.9-fixes-2 2024-05-08 09:37:58 -07:00
pcmcia
peci
perf ARM: 2024-05-15 14:46:43 -07:00
phy Merge tag 'drm-msm-next-2024-05-07' of https://gitlab.freedesktop.org/drm/msm into drm-next 2024-05-10 10:22:59 +10:00
pinctrl gpio updates for v6.10-rc1 2024-05-14 15:07:07 -07:00
platform platform-drivers-x86 for v6.10-1 2024-05-16 09:14:50 -07:00
pmdomain pmdomain: Merge branch fixes into next 2024-05-03 15:48:21 +02:00
pnp
power
powercap
pps
ps3
ptp Networking changes for 6.10. 2024-05-14 19:42:24 -07:00
pwm pwm: pca9685: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-10 07:30:27 +02:00
rapidio
ras
regulator regulator: Updates for v6.10 2024-05-14 14:36:09 -07:00
remoteproc
reset
rpmsg
rtc
s390 Networking changes for 6.10. 2024-05-14 19:42:24 -07:00
sbus
scsi SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Add timeout for wait operation 2024-05-03 07:30:32 +02:00
soc spi: Updates for v6.10 2024-05-14 14:41:01 -07:00
soundwire
spi spi: Updates for v6.10 2024-05-14 14:41:01 -07:00
spmi
ssb
staging media updates for v6.10-rc1 2024-05-16 08:45:44 -07:00
target SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
tc
tee
thermal ACPI updates for 6.10-rc1 2024-05-14 13:31:24 -07:00
thunderbolt
tty printk changes for 6.10 2024-05-15 12:34:46 -07:00
ufs SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
uio
usb SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
vdpa
vfio ARM development updates for v6.10-rc1 2024-05-17 08:53:47 -07:00
vhost
video fbdev fixes and cleanups for 6.10-rc1: 2024-05-15 09:53:06 -07:00
virt ACPI updates for 6.10-rc1 2024-05-14 13:31:24 -07:00
virtio virtio_ring: enable premapped mode whatever use_dma_api 2024-05-13 17:07:41 -07:00
w1
watchdog
xen
zorro
Kconfig
Makefile