]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.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 14:47:09 +0000 (14:47 +0000)
commite0f5252ed1ba0e1634e282a953a456da1ae637d6
tree7d302bebd9b0369aa15f99d7cec45920c81b1494
parent4c32a1d125c7a541a0a4a95186e2af3b6d0a9004
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/cadence_gem.c