net: mipsnet: check packet length against buffer
commit7a2c32ec06533c54ddaf70136bfbd89eeaf6db16
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 7 Apr 2016 10:26:02 +0000 (7 15:56 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Aug 2016 19:28:45 +0000 (9 14:28 -0500)
tree38ba9da07ab1ef93c5f04b56ccf90cd5459306fd
parent780d8317c81c5632ccc44194aaca798e11e3acb9
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>
(cherry picked from commit 3af9187fc6caaf415ab9c0c6d92c9678f65cb17f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/mipsnet.c