linux-sg2042/drivers
Willem de Bruijn fd3a886258 net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan
Tun, tap, virtio, packet and uml vector all use struct virtio_net_hdr
to communicate packet metadata to userspace.

For skbuffs with vlan, the first two return the packet as it may have
existed on the wire, inserting the VLAN tag in the user buffer.  Then
virtio_net_hdr.csum_start needs to be adjusted by VLAN_HLEN bytes.

Commit f09e2249c4 ("macvtap: restore vlan header on user read")
added this feature to macvtap. Commit 3ce9b20f19 ("macvtap: Fix
csum_start when VLAN tags are present") then fixed up csum_start.

Virtio, packet and uml do not insert the vlan header in the user
buffer.

When introducing virtio_net_hdr_from_skb to deduplicate filling in
the virtio_net_hdr, the variant from macvtap which adds VLAN_HLEN was
applied uniformly, breaking csum offset for packets with vlan on
virtio and packet.

Make insertion of VLAN_HLEN optional. Convert the callers to pass it
when needed.

Fixes: e858fae2b0 ("virtio_net: use common code for virtio_net_hdr and skb GSO conversion")
Fixes: 1276f24eee ("packet: use common code for virtio_net_hdr and skb GSO conversion")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-07 16:15:38 -04:00
..
accessibility
acpi * Stratix10 SDRAM support to altera_edac (Thor Thayer) 2018-06-06 15:36:13 -07:00
amba Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-06-06 13:49:25 -07:00
android
ata Merge branch 'for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2018-06-05 17:01:41 -07:00
atm atm: zatm: fix memcmp casting 2018-05-29 09:59:53 -04:00
auxdisplay
base - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
bcma dma-mapping updates for 4.18: 2018-06-04 10:58:12 -07:00
block Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-04 10:00:01 -07:00
bluetooth Bluetooth: btusb: Add additional device ID for RTL8822BE 2018-05-30 15:45:01 +02:00
bus
cdrom
char It's been a busy release for the IPMI driver. Some notable changes: 2018-06-06 15:48:10 -07:00
clk - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
clocksource clocksource/drivers/mxs_timer: Switch to SPDX identifier 2018-05-23 07:39:09 +02:00
connector Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
cpufreq ACPI updates for 4.18-rc1 2018-06-05 10:08:27 -07:00
cpuidle powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-06-05 15:51:21 -07:00
dax - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
dca
devfreq
dio
dma - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
dma-buf
edac EDAC, ghes: Make platform-based whitelisting x86-only 2018-05-21 12:18:57 +02:00
eisa
extcon
firewire treewide: Use struct_size() for kmalloc()-family 2018-06-06 11:15:43 -07:00
firmware Char/Misc driver patches for 4.18-rc1 2018-06-05 16:20:22 -07:00
fmc
fpga fpga: clarify that unregister functions also free 2018-05-25 18:23:56 +02:00
fsi
gpio - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
gpu media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
hid
hsi
hv
hwmon powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
hwspinlock treewide: Use struct_size() for devm_kmalloc() and friends 2018-06-06 11:15:43 -07:00
hwtracing Char/Misc driver patches for 4.18-rc1 2018-06-05 16:20:22 -07:00
i2c USB/PHY patches for 4.18-rc1 2018-06-05 16:14:12 -07:00
ide dma-mapping updates for 4.18: 2018-06-04 10:58:12 -07:00
idle
iio
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
input - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
iommu dma-mapping updates for 4.18: 2018-06-04 10:58:12 -07:00
ipack
irqchip irqchip/stm32: Add suspend/resume support for hierarchy domain 2018-05-24 12:38:22 +01:00
isdn Merge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-04 13:57:43 -07:00
leds leds: class: ensure workqueue is initialized before setting brightness 2018-05-24 22:08:26 +02:00
lightnvm lightnvm: pblk: take bitmap alloc. out of critical section 2018-06-01 09:02:53 -06:00
macintosh powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
mailbox
mcb
md - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
media media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
memory
memstick
message Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-04 10:00:01 -07:00
mfd - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
misc powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
mmc MMC core: 2018-06-05 16:11:43 -07:00
mtd - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
mux
net net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan 2018-06-07 16:15:38 -04:00
nfc NFC: pn533: don't send USB data off of the stack 2018-05-31 12:43:14 +02:00
ntb
nubus Char/Misc driver patches for 4.18-rc1 2018-06-05 16:20:22 -07:00
nvdimm
nvme Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-06-04 15:54:04 -07:00
nvmem
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
opp OPP: Allow same OPP table to be used for multiple genpd 2018-05-30 15:38:21 +05:30
oprofile
parisc dma-mapping updates for 4.18: 2018-06-04 10:58:12 -07:00
parport
pci Power management updates for 4.18-rc1 2018-06-05 09:38:39 -07:00
pcmcia
perf
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
pinctrl - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
platform USB/PHY patches for 4.18-rc1 2018-06-05 16:14:12 -07:00
pnp media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
power USB/PHY patches for 4.18-rc1 2018-06-05 16:14:12 -07:00
powercap
pps
ps3
ptp ptp_qoriq: move some definitions to header file 2018-05-28 23:05:11 -04:00
pwm
rapidio
ras
regulator treewide: Use struct_size() for devm_kmalloc() and friends 2018-06-06 11:15:43 -07:00
remoteproc
reset - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
rpmsg
rtc - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
sfi
sh
siox
slimbus
sn
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
soundwire Char/Misc driver patches for 4.18-rc1 2018-06-05 16:20:22 -07:00
spi Power management updates for 4.18-rc1 2018-06-05 09:38:39 -07:00
spmi
ssb
staging media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
target for-4.18/block-20180603 2018-06-04 07:58:06 -07:00
tc
tee
thermal - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
thunderbolt
tty powerpc updates for 4.18 2018-06-07 10:23:33 -07:00
uio
usb - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
uwb
vfio Merge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-04 13:57:43 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
video media updates for v4.18-rc1 2018-06-07 12:34:37 -07:00
virt
virtio
visorbus
vlynq
vme
w1 Char/Misc driver patches for 4.18-rc1 2018-06-05 16:20:22 -07:00
watchdog
xen
zorro - Introduce arithmetic overflow test helper functions (Rasmus) 2018-06-06 17:27:14 -07:00
Kconfig
Makefile