net: stellaris_enet: check packet length against receive buffer
commit3a15cc0e1ee7168db0782133d2607a6bfa422d66
authorPrasad J Pandit <pjp@fedoraproject.org>
Fri, 8 Apr 2016 06:03:48 +0000 (8 11:33 +0530)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 11 Apr 2016 13:22:33 +0000 (11 14:22 +0100)
treeb6710f8c71ea355b2c4f902f456f331cc6775ce9
parent5144fe36056d3a94b0d8da9e10adc555c057baa8
net: stellaris_enet: check packet length against receive buffer

When receiving packets over Stellaris ethernet controller, it
uses receive buffer of size 2048 bytes. In case the controller
accepts large(MTU) packets, it could lead to memory corruption.
Add check to avoid it.

Reported-by: Oleksandr Bazhaniuk <oleksandr.bazhaniuk@intel.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 1460095428-22698-1-git-send-email-ppandit@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/net/stellaris_enet.c