net: cadence_gem: check packet size in gem_recieve
commit244381ec19ce1412b474f41b5f30fe1da846451b
authorPrasad J Pandit <pjp@fedoraproject.org>
Fri, 15 Jan 2016 07:00:40 +0000 (15 12:30 +0530)
committerJason Wang <jasowang@redhat.com>
Thu, 4 Feb 2016 05:22:06 +0000 (4 13:22 +0800)
tree5504876e9841404fb9f5ba5fc0863327e332c391
parentc8c6afa8867b43e6b2a0553a8eb6c880f27a8379
net: cadence_gem: check packet size in gem_recieve

While receiving packets in 'gem_receive' routine, if Frame Check
Sequence(FCS) is enabled, it copies the packet into a local
buffer without checking its size. Add check to validate packet
length against the buffer size to avoid buffer overflow.

Reported-by: Ling Liu <liuling-it@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/cadence_gem.c