]> xenbits.xensource.com Git - qemu-upstream-4.6-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 13:58:51 +0000 (13:58 +0000)
commit7b57f9d78b84483818a3faf34dad628b3bdc6a5b
tree0a96b43e9ced035f6b4a2898b574ae5b3b22befb
parentbd38ad19a5b209af05d3986477e48c44fb2b8047
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