net: mipsnet: check packet length against buffer
commit3af9187fc6caaf415ab9c0c6d92c9678f65cb17f
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 7 Apr 2016 10:26:02 +0000 (7 15:56 +0530)
committerJason Wang <jasowang@redhat.com>
Wed, 25 May 2016 07:46:07 +0000 (25 15:46 +0800)
tree25d97e4e95fe277643d573806fa58126768df212
parent11196e95f0521fa6ba689c15f874ad9a2d99e158
net: mipsnet: check packet length against buffer

When receiving packets over MIPSnet network device, it uses
receive buffer of size 1514 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>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/mipsnet.c