net: calxedaxgmac: throw away overrun frames
authorRob Herring <rob.herring@calxeda.com>
Wed, 16 Jan 2013 13:36:37 +0000 (13:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jan 2013 19:14:52 +0000 (14:14 -0500)
commitd6fb3be544b46a7611a3373fcaa62b5b0be01888
tree5e053611bbc52fd1f00686d0ad6a11a607b7aa25
parent2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86
net: calxedaxgmac: throw away overrun frames

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>
drivers/net/ethernet/calxeda/xgmac.c