android_kernel_xiaomi_sm8350/drivers/net
Sean Anderson 0e8de8f54b net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD
[ Upstream commit 878e2405710aacfeeb19364c300f38b7a9abfe8f ]

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:04:07 +02:00
..
appletalk
arcnet
bonding bonding: 802.3ad: fix no transmission of LACPDUs 2022-09-05 10:27:40 +02:00
caif caif_virtio: fix race between virtio_device_ready() and ndo_open() 2022-07-07 17:36:49 +02:00
can can: gs_usb: gs_can_open(): fix race dev->can.state condition 2022-09-28 11:04:07 +02:00
dsa net: dsa: microchip: ksz9477: fix fdb_dump last invalid entry 2022-08-25 11:18:30 +02:00
ethernet net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD 2022-09-28 11:04:07 +02:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 ieee802154: cc2520: add rc code in cc2520_tx() 2022-09-20 12:27:59 +02:00
ipvlan ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header 2022-09-28 11:04:05 +02:00
netdevsim netdevsim: Avoid allocation warnings triggered from user space 2022-08-25 11:17:49 +02:00
phy net: dp83822: disable rx error interrupt 2022-09-20 12:28:00 +02:00
plip plip: avoid rcu debug splat 2022-08-25 11:18:24 +02:00
ppp
slip
team net: team: Unsync device addresses on ndo_stop 2022-09-28 11:04:05 +02:00
usb net: usb: qmi_wwan: add Quectel RM520N 2022-09-28 11:03:59 +02:00
vmxnet3
wan
wimax
wireless wifi: iwlegacy: 4965: corrected fix for potential off-by-one overflow in il4965_rs_fill_link_cmd() 2022-09-15 12:04:49 +02:00
xen-netback xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue 2022-07-21 20:59:16 +02:00
dummy.c
eql.c
geneve.c geneve: do not use RT_TOS for IPv6 flowlabel 2022-08-25 11:18:24 +02:00
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
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 net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-08-03 11:59:39 +02:00
tap.c
thunderbolt.c
tun.c net: tun: avoid disabling NAPI twice 2022-07-07 17:36:50 +02:00
veth.c
virtio_net.c virtio-net: fix the race between refill work and close 2022-08-03 11:59:41 +02:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: force data bouncing when backend is untrusted 2022-07-07 17:36:53 +02:00