[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 17/30] openpic: avoid buffer overrun on incom
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v4 17/30] openpic: avoid buffer overrun on incoming migration |
Date: |
Mon, 31 Mar 2014 16:55:50 +0100 |
On 31 March 2014 15:17, Michael S. Tsirkin <address@hidden> wrote:
> From: Michael Roth <address@hidden>
>
> CVE-2013-4534
>
> opp->nb_cpus is read from the wire and used to determine how many
> IRQDest elements to read into opp->dst[]. If the value exceeds the
> length of opp->dst[], MAX_CPU, opp->dst[] can be overrun with arbitrary
> data from the wire.
>
> Fix this by failing migration if the value read from the wire exceeds
> MAX_CPU.
>
> Signed-off-by: Michael Roth <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
> hw/intc/openpic.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
> index be76fbd..8cb16da 100644
> --- a/hw/intc/openpic.c
> +++ b/hw/intc/openpic.c
> @@ -1429,6 +1429,9 @@ static int openpic_load(QEMUFile* f, void *opaque, int
> version_id)
> qemu_get_be32s(f, &opp->tfrr);
>
> qemu_get_be32s(f, &opp->nb_cpus);
> + if (opp->nb_cpus > MAX_CPU) {
> + return -EINVAL;
> + }
nb_cpus is a device property so we shouldn't be reading
it off the wire at all. I would suggest treating it as
a "read but ignore value", assuming we care about migration
back-compatibility for this device, or possibly "read and
confirm it matches the value we already have".
thanks
-- PMM
- [Qemu-devel] [PATCH v4 10/30] hw/pci/pcie_aer.c: fix buffer overruns on invalid state load, (continued)
- [Qemu-devel] [PATCH v4 10/30] hw/pci/pcie_aer.c: fix buffer overruns on invalid state load, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 12/30] vmstate: fix buffer overflow in target-arm/machine.c, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 13/30] stellaris_enet: avoid buffer overrun on incoming migration, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 14/30] stellaris_enet: avoid buffer overrun on incoming migration (part 2), Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 15/30] stellaris_enet: avoid buffer orerrun on incoming migration (part 3), Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 16/30] virtio: avoid buffer overrun on incoming migration, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 17/30] openpic: avoid buffer overrun on incoming migration, Michael S. Tsirkin, 2014/03/31
- Re: [Qemu-devel] [PATCH v4 17/30] openpic: avoid buffer overrun on incoming migration,
Peter Maydell <=
- [Qemu-devel] [PATCH v4 18/30] virtio: validate num_sg when mapping, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 19/30] pxa2xx: avoid buffer overrun on incoming migration, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 21/30] ssd0323: fix buffer overun on invalid state load, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 20/30] ssi-sd: fix buffer overrun on invalid state load, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 23/30] zaurus: fix buffer overrun on invalid state load, Michael S. Tsirkin, 2014/03/31
- [Qemu-devel] [PATCH v4 22/30] tsc210x: fix buffer overrun on invalid state load, Michael S. Tsirkin, 2014/03/31