net: calxedaxgmac: throw away overrun frames
authorRob Herring <rob.herring@calxeda.com>
Wed, 16 Jan 2013 13:36:37 +0000 (13:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 18:49:00 +0000 (10:49 -0800)
commitf0adabb18a751ecff5da1e03d47b13dd9628b89b
treeaea054d5d6ad580c79d2774a5a7b8f5403ed195a
parent07da6b22a219ba7907ad41118f0e77f4b8fae9a9
net: calxedaxgmac: throw away overrun frames

[ Upstream commit d6fb3be544b46a7611a3373fcaa62b5b0be01888 ]

The xgmac driver assumes 1 frame per descriptor. If a frame larger than
the descriptor's buffer size is received, the frame will spill over into
the next descriptor. So check for received frames that span more than one
descriptor and discard them. This prevents a crash if we receive erroneous
large packets.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/calxeda/xgmac.c