Anssi Hannula cd22455364 net: xilinx_emaclite: fix receive buffer overflow
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: bb81b2ddfa19 ("net: add Xilinx emac lite device driver")
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-15 12:18:33 -05:00
..
2017-01-25 15:35:11 +05:30
2017-01-06 10:49:36 -08:00
2017-02-06 14:37:55 -08:00
2017-01-26 17:49:14 +02:00
2017-02-03 13:46:38 -08:00
2017-02-08 10:51:24 -08:00
2017-01-20 12:25:11 -08:00
2017-02-03 22:19:15 +01:00