linux/drivers/net
Íñigo Huguet adf6a0f8c0 rtl8xxxu: avoid parsing short RX packet
One USB data buffer can contain multiple received network
packets. If that's the case, they're processed this way:
1. Original buffer is cloned
2. Original buffer is trimmed to contain only the first
   network packet
3. This first network packet is passed to network stack
4. Cloned buffer is trimmed to eliminate the first network
   packet
5. Repeat with the cloned buffer until there are no more
   network packets inside

However, if the space remaining in original buffer after
the first network packet is not enough to contain at least
another network packet descriptor, it is not cloned.

The loop parsing this packets ended if remaining space == 0.
But if the remaining space was > 0 but < packet descriptor
size, another iteration of the loop was done, processing again
the previous packet because cloning didn't happen. Moreover,
the ownership of this packet had been passed to network
stack in the previous iteration.

This patch ensures that no extra iteration is done if the
remaining size is not enough for one packet, and also avoid
the first iteration for the same reason.

Probably this doesn't happen in practice, but can happen
theoretically.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210511071926.8951-1-ihuguet@redhat.com
2021-06-19 12:06:09 +03:00
..
appletalk
arcnet
bonding net: bonding: Use per-cpu rr_tx_counter 2021-06-15 11:26:15 -07:00
caif
can
dsa net: dsa: xrs700x: forward HSR supervision frames 2021-06-16 12:17:03 -07:00
ethernet net: marvell: prestera: Add matchall support 2021-06-16 12:58:27 -07:00
fddi
fjes fjes: check return value after calling platform_get_resource() 2021-06-10 13:53:13 -07:00
hamradio hamradio: bpqether: Fix -Wunused-const-variable warning 2021-06-01 17:00:51 -07:00
hippi
hyperv
ieee802154 Merge tag 'ieee802154-for-davem-2021-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2021-06-03 15:21:58 -07:00
ipa net: ipa: introduce sysfs code 2021-06-11 14:13:18 -07:00
ipvlan
mdio net: mdio: mscc-miim: Use devm_platform_get_and_ioremap_resource() 2021-06-11 13:10:20 -07:00
mhi net: mhi_net: make mhi_wwan_ops static 2021-06-16 00:38:02 -07:00
netdevsim drivers: net: netdevsim: add devlink trap_drop_counter_get implementation 2021-06-14 13:04:25 -07:00
pcs net: pcs: xpcs: export xpcs_do_config and xpcs_link_up 2021-06-11 13:43:56 -07:00
phy net: phy: replace if-else statements with switch 2021-06-16 12:34:07 -07:00
plip
ppp
slip
team
usb net: usb: asix: ax88772: manage PHY PM from MAC 2021-06-11 13:00:31 -07:00
vmxnet3
wan net: cosa: remove redundant spaces 2021-06-16 00:52:33 -07:00
wireguard wireguard: allowedips: free empty intermediate nodes when removing single node 2021-06-04 14:25:14 -07:00
wireless rtl8xxxu: avoid parsing short RX packet 2021-06-19 12:06:09 +03:00
wwan net: iosm: remove the repeated declaration and comment 2021-06-16 12:18:57 -07:00
xen-netback
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix a typo 2021-06-01 17:05:04 -07:00
ifb.c
Kconfig net: wwan: Fix WWAN config symbols 2021-06-14 13:17:10 -07:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c macvlan: Fix a typo 2021-06-01 17:05:04 -07:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c virtio_net: Remove BUG() to avoid machine dead 2021-06-07 13:06:46 -07:00
vrf.c vrf: Fix a typo 2021-06-01 17:05:04 -07:00
vsockmon.c
vxlan.c
xen-netfront.c