linux/drivers/net
Sean Anderson 75ca7f44da net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD
[ Upstream commit 878e240571 ]

There is a separate receive path for small packets (under 256 bytes).
Instead of allocating a new dma-capable skb to be used for the next packet,
this path allocates a skb and copies the data into it (reusing the existing
sbk for the next packet). There are two bytes of junk data at the beginning
of every packet. I believe these are inserted in order to allow aligned DMA
and IP headers. We skip over them using skb_reserve. Before copying over
the data, we must use a barrier to ensure we see the whole packet. The
current code only synchronizes len bytes, starting from the beginning of
the packet, including the junk bytes. However, this leaves off the final
two bytes in the packet. Synchronize the whole packet.

To reproduce this problem, ping a HME with a payload size between 17 and
214

	$ ping -s 17 <hme_address>

which will complain rather loudly about the data mismatch. Small packets
(below 60 bytes on the wire) do not have this issue. I suspect this is
related to the padding added to increase the minimum packet size.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220920235018.1675956-1-seanga2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-09-28 11:10:37 +02:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:09:35 +01:00
bonding net: bonding: Unsync device addresses on ndo_stop 2022-09-28 11:10:31 +02:00
caif caif_virtio: fix race between virtio_device_ready() and ndo_open() 2022-07-07 17:52:18 +02:00
can can: gs_usb: gs_can_open(): fix race dev->can.state condition 2022-09-28 11:10:36 +02:00
dsa net: dsa: mv88e6xxx: allow use of PHYs on CPU and DSA ports 2022-09-23 14:16:57 +02:00
ethernet net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD 2022-09-28 11:10:37 +02:00
fddi
fjes fjes: Check for error irq 2021-12-29 12:25:57 +01:00
hamradio hamradio: remove needs_free_netdev to avoid UAF 2022-04-20 09:23:09 +02:00
hippi drivers: net: hippi: Fix deadlock in rr_close() 2022-05-09 09:05:06 +02:00
hyperv hv_netvsc: Fix potential dereference of NULL pointer 2022-06-09 10:21:12 +02:00
ieee802154 ieee802154: cc2520: add rc code in cc2520_tx() 2022-09-20 12:38:32 +02:00
ipa net: ipa: properly limit modem routing table use 2022-09-28 11:10:34 +02:00
ipvlan ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header 2022-09-28 11:10:30 +02:00
mdio of: mdio: Add of_node_put() when breaking out of for_each_xx 2022-09-28 11:10:33 +02:00
netdevsim net: Use u64_stats_fetch_begin_irq() for stats fetch. 2022-09-08 11:11:40 +02:00
pcs
phy net: phy: aquantia: wait for the suspend/resume operations to finish 2022-09-28 11:10:31 +02:00
plip plip: avoid rcu debug splat 2022-08-25 11:37:59 +02:00
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 10:54:01 +01:00
slip drivers: net: slip: fix NPD bug in sl_tx_timeout() 2022-04-20 09:23:24 +02:00
team net: team: Unsync device addresses on ndo_stop 2022-09-28 11:10:31 +02:00
usb net: usb: qmi_wwan: add Quectel RM520N 2022-09-23 14:17:00 +02:00
vmxnet3 net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup() 2022-05-25 09:17:58 +02:00
wan
wimax
wireguard wireguard: netlink: avoid variable-sized memcpy on sockaddr 2022-09-28 11:10:34 +02:00
wireless wifi: mt76: fix reading current per-tid starting sequence number for aggregation 2022-09-28 11:10:27 +02:00
xen-netback xen-netback: only remove 'hotplug-status' when the vif is actually destroyed 2022-09-15 11:32:05 +02:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-04-08 14:40:22 +02:00
dummy.c
eql.c
geneve.c geneve: fix TOS inheriting for ipv4 2022-08-25 11:38:02 +02:00
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 14:03:49 +01:00
Kconfig lib/crypto: blake2s: include as built-in 2022-05-30 09:33:26 +02:00
LICENSE.SRC
loopback.c
macsec.c net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa() 2022-08-03 12:00:48 +02:00
macvlan.c
macvtap.c macvtap: advertise link netns via netlink 2022-04-13 21:00:59 +02:00
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-08-03 12:00:46 +02:00
tap.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 21:00:59 +02:00
thunderbolt.c
tun.c tun: avoid double free in tun_free_netdev 2022-08-11 13:06:44 +02:00
veth.c veth: Ensure eth header is in skb's linear part 2022-04-20 09:23:11 +02:00
virtio_net.c virtio_net: fix memory leak inside XPD_TX with mergeable 2022-08-25 11:37:57 +02:00
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 11:32:36 +01:00
vsockmon.c
vxlan.c vxlan: fix error return code in vxlan_fdb_append 2022-04-27 13:53:53 +02:00
xen-netfront.c xen-netfront: restore __skb_queue_tail() positioning in xennet_get_responses() 2022-07-07 17:52:23 +02:00