]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commit
pcnet: force the buffer access to be in bounds during tx
authorPetr Matousek <pmatouse@redhat.com>
Sun, 24 May 2015 08:53:44 +0000 (10:53 +0200)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 10 Jun 2015 11:51:11 +0000 (11:51 +0000)
commitd2382550f9d563da371b79e1b97b2453c77b3c8e
treee5c1a8e3010a9f505f2a0c738af8b47adcad92f0
parent4e407efbe2f8661e62050edeea45ee3ef2d43808
pcnet: force the buffer access to be in bounds during tx

4096 is the maximum length per TMD and it is also currently the size of
the relay buffer pcnet driver uses for sending the packet data to QEMU
for further processing. With packet spanning multiple TMDs it can
happen that the overall packet size will be bigger than sizeof(buffer),
which results in memory corruption.

Fix this by only allowing to queue maximum sizeof(buffer) bytes.

This is CVE-2015-3209.

Signed-off-by: Petr Matousek <pmatouse@redhat.com>
Reported-by: Matt Tait <matttait@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/pcnet.c