exynos-linux-stable/drivers/net/ethernet/xilinx
Anssi Hannula a2901d01a6 net: xilinx_emaclite: fix receive buffer overflow
[ Upstream commit cd224553641848dd17800fe559e4ff5d208553e8 ]

xilinx_emaclite looks at the received data to try to determine the
Ethernet packet length but does not properly clamp it if
proto_type == ETH_P_IP or 1500 < proto_type <= 1518, causing a buffer
overflow and a panic via skb_panic() as the length exceeds the allocated
skb size.

Fix those cases.

Also add an additional unconditional check with WARN_ON() at the end.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Fixes: bb81b2ddfa ("net: add Xilinx emac lite device driver")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-17 06:41:49 +02:00
..
Kconfig net: ethernet: xilinx: Enable emaclite for MIPS 2016-09-08 16:06:37 -07:00
ll_temac.h net: ethernet: ll_temac: use phydev from struct net_device 2016-07-14 17:42:30 -07:00
ll_temac_main.c net: ethernet: ll_temac: use phy_ethtool_{get|set}_link_ksettings 2016-07-14 17:42:31 -07:00
ll_temac_mdio.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
Makefile drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver 2012-01-25 16:59:47 -05:00
xilinx_axienet.h net: ethernet: xilinx: axienet: use phydev from struct net_device 2016-07-15 16:41:34 -07:00
xilinx_axienet_main.c net: axienet: Remove unused parameter from __axienet_device_reset 2016-10-13 12:15:28 -04:00
xilinx_axienet_mdio.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
xilinx_emaclite.c net: xilinx_emaclite: fix receive buffer overflow 2017-06-17 06:41:49 +02:00