mirror_ubuntu-kernels/drivers/net/ethernet/sfc/falcon
Edward Cree 6dc5774dee sfc: allocate a big enough SKB for loopback selftest packet
Cited commits passed a size to alloc_skb that was only big enough for
 the actual packet contents, but the following skb_put + memcpy writes
 the whole struct efx_loopback_payload including leading and trailing
 padding bytes (which are then stripped off with skb_pull/skb_trim).
This could cause an skb_over_panic, although in practice we get saved
 by kmalloc_size_roundup.
Pass the entire size we use, instead of the size of the final packet.

Reported-by: Andy Moreton <andy.moreton@amd.com>
Fixes: cf60ed4696 ("sfc: use padding to fix alignment in loopback test")
Fixes: 30c24dd87f ("sfc: siena: use padding to fix alignment in loopback test")
Fixes: 1186c6b31e ("sfc: falcon: use padding to fix alignment in loopback test")
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230821180153.18652-1-edward.cree@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-08-22 11:09:53 -07:00
..
bitfield.h sfc:falcon: fix repeated words in comments 2022-06-27 11:59:54 +01:00
efx.c sfc: falcon: Drop redundant pci_enable_pcie_error_reporting() 2023-03-08 23:34:39 -08:00
efx.h
enum.h
ethtool.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
falcon_boards.c
falcon.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
farch_regs.h
farch.c sfc: falcon: Use the bitmap API to allocate bitmaps 2022-07-06 19:54:42 -07:00
filter.h
io.h
Kconfig
Makefile
mdio_10g.c
mdio_10g.h
mtd.c
net_driver.h sfc/falcon: fix repeated words in comments 2022-07-26 12:35:37 +02:00
nic.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
nic.h
phy.h
qt202x_phy.c
rx.c sfc: Stop using iommu_present() 2022-04-07 21:04:10 -07:00
selftest.c sfc: allocate a big enough SKB for loopback selftest packet 2023-08-22 11:09:53 -07:00
selftest.h
tenxpress.c
tx.c net: allow gso_max_size to exceed 65536 2022-05-16 10:18:55 +01:00
tx.h
txc43128_phy.c
workarounds.h