]> xenbits.xensource.com Git - qemu-xen.git/commit
net: cadence_gem: check packet size in gem_recieve
authorPrasad J Pandit <pjp@fedoraproject.org>
Fri, 15 Jan 2016 07:00:40 +0000 (12:30 +0530)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 5 Feb 2016 12:05:33 +0000 (12:05 +0000)
commitec963204db85b8e7c5758c76a9ec7d21eb256925
tree69b11afe33ff9a12724c6ad186e16e64ccc5ac8b
parentb5c0247eec22a343bc135bc8edd7e2f607094b73
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