qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ani Sinha <ani@anisinha.ca>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] acpi: validate hotplug selector on access
Date: Tue, 21 Dec 2021 22:07:27 +0530 (IST)	[thread overview]
Message-ID: <alpine.OSX.2.20.2112212206440.2253@athabasca.local> (raw)
In-Reply-To: <20211221144852.589983-1-mst@redhat.com>



On Tue, 21 Dec 2021, Michael S. Tsirkin wrote:

> When bus is looked up on a pci write, we didn't
> validate that the lookup succeeded.
> Fuzzers thus can trigger QEMU crash by dereferencing the NULL
> bus pointer.

Good fix. Nice catch.

>
> Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device")
> Cc: "Igor Mammedov" <imammedo@redhat.com>
> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Reviewed-by: Ani Sinha <ani@anisinha.ca>

> ---
>  hw/acpi/pcihp.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
> index 30405b5113..a5e182dd3a 100644
> --- a/hw/acpi/pcihp.c
> +++ b/hw/acpi/pcihp.c
> @@ -491,6 +491,9 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t data,
>          }
>
>          bus = acpi_pcihp_find_hotplug_bus(s, s->hotplug_select);
> +        if (!bus) {
> +            break;
> +        }
>          QTAILQ_FOREACH_SAFE(kid, &bus->qbus.children, sibling, next) {
>              Object *o = OBJECT(kid->child);
>              PCIDevice *dev = PCI_DEVICE(o);
> --
> MST
>
>


  parent reply	other threads:[~2021-12-21 16:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 14:48 [PATCH] acpi: validate hotplug selector on access Michael S. Tsirkin
2021-12-21 14:58 ` Philippe Mathieu-Daudé
2021-12-21 16:37 ` Ani Sinha [this message]
2021-12-22 19:19 ` Philippe Mathieu-Daudé
2021-12-22 20:19   ` Michael S. Tsirkin
2021-12-22 20:27     ` Philippe Mathieu-Daudé
2021-12-22 20:52       ` Michael S. Tsirkin
2021-12-23  9:58         ` Mauro Matteo Cascella
2021-12-23 13:43           ` Michael S. Tsirkin
2021-12-23 20:46             ` Mauro Matteo Cascella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.2112212206440.2253@athabasca.local \
    --to=ani@anisinha.ca \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).