References: bsc#962360 CVE-2015-7512 Backends could provide a packet whose length is greater than buffer size. Check for this and truncate the packet to avoid rx buffer overflow in this case. Cc: Prasad J Pandit Cc: address@hidden Signed-off-by: Jason Wang --- hw/net/pcnet.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: xen-4.6.0-testing/tools/qemu-xen-dir-remote/hw/net/pcnet.c =================================================================== --- xen-4.6.0-testing.orig/tools/qemu-xen-dir-remote/hw/net/pcnet.c +++ xen-4.6.0-testing/tools/qemu-xen-dir-remote/hw/net/pcnet.c @@ -1086,6 +1086,12 @@ ssize_t pcnet_receive(NetClientState *nc int pktcount = 0; if (!s->looptest) { + if (size > 4092) { +#ifdef PCNET_DEBUG_RMD + fprintf(stderr, "pcnet: truncates rx packet.\n"); +#endif + size = 4092; + } memcpy(src, buf, size); /* no need to compute the CRC */ src[size] = 0;