linux/drivers/net
Bailey Forrest fcdfc0413a gve: Fix an edge case for TSO skb validity check
commit 36e3b949e3 upstream.

The NIC requires each TSO segment to not span more than 10
descriptors. NIC further requires each descriptor to not exceed
16KB - 1 (GVE_TX_MAX_BUF_SIZE_DQO).

The descriptors for an skb are generated by
gve_tx_add_skb_no_copy_dqo() for DQO RDA queue format.
gve_tx_add_skb_no_copy_dqo() loops through each skb frag and
generates a descriptor for the entire frag if the frag size is
not greater than GVE_TX_MAX_BUF_SIZE_DQO. If the frag size is
greater than GVE_TX_MAX_BUF_SIZE_DQO, it is split into descriptor(s)
of size GVE_TX_MAX_BUF_SIZE_DQO and a descriptor is generated for
the remainder (frag size % GVE_TX_MAX_BUF_SIZE_DQO).

gve_can_send_tso() checks if the descriptors thus generated for an
skb would meet the requirement that each TSO-segment not span more
than 10 descriptors. However, the current code misses an edge case
when a TSO segment spans multiple descriptors within a large frag.
This change fixes the edge case.

gve_can_send_tso() relies on the assumption that max gso size (9728)
is less than GVE_TX_MAX_BUF_SIZE_DQO and therefore within an skb
fragment a TSO segment can never span more than 2 descriptors.

Fixes: a57e5de476 ("gve: DQO: Add TX path")
Signed-off-by: Praveen Kaligineedi <pkaligineedi@google.com>
Signed-off-by: Bailey Forrest <bcf@google.com>
Reviewed-by: Jeroen de Borst <jeroendb@google.com>
Cc: stable@vger.kernel.org
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20240724143431.3343722-1-pkaligineedi@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:17 +02:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:36:35 +01:00
bonding bonding: Fix out-of-bounds read in bond_option_arp_ip_targets_set() 2024-07-18 13:07:31 +02:00
caif
can can: kvaser_usb: fix return value for hif_usb_send_regout 2024-07-27 10:46:11 +02:00
dsa net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports 2024-08-19 05:45:07 +02:00
ethernet gve: Fix an edge case for TSO skb validity check 2024-08-19 05:45:17 +02:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-02-23 08:54:30 +01:00
hamradio
hippi
hyperv hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed 2024-03-15 10:48:21 -04:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-08 17:26:38 +01:00
ipa
ipvlan ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-06-16 13:39:52 +02:00
mctp
mdio
netdevsim
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:01:43 +02:00
phy net: phy: micrel: add Microchip KSZ 9477 to the device table 2024-07-05 09:14:41 +02:00
plip
ppp ppp: reject claimed-as-LCP but actually malformed packets 2024-07-18 13:07:38 +02:00
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 15:17:41 +01:00
usb net: usb: qmi_wwan: add Telit FN912 compositions 2024-07-27 10:46:12 +02:00
vmxnet3
vxlan vxlan: Fix regression when dropping packets due to invalid src addresses 2024-07-05 09:14:06 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 21:59:06 +02:00
wireguard wireguard: send: annotate intentional data race in checking empty queue 2024-07-18 13:07:43 +02:00
wireless wifi: mwifiex: Fix interface type change 2024-08-19 05:45:14 +02:00
wwan
xen-netback xen-netback: properly sync TX responses 2024-02-23 08:55:05 +01:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: fix header validation in geneve[6]_xmit_skb 2024-04-17 11:15:14 +02:00
gtp.c net: gtp: Fix Use-After-Free in gtp_dellink 2024-05-02 16:24:45 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:08:16 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 16:56:25 +00:00
macvtap.c
Makefile net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled 2024-06-16 13:39:46 +02:00
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c net: netconsole: Disable target before netpoll cleanup 2024-08-19 05:45:11 +02:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tap: add missing verification for short frame 2024-07-27 10:46:18 +02:00
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 13:18:23 +02:00
tun.c tun: add missing verification for short frame 2024-07-27 10:46:17 +02:00
veth.c net: veth: do not manipulate GRO when using XDP 2024-03-26 18:21:35 -04:00
virtio_net.c virtio_net: checksum offloading handling fix 2024-07-05 09:14:31 +02:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:19:37 +02:00