All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [FIX PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add
Date: Wed, 26 Aug 2015 09:17:09 -0500	[thread overview]
Message-ID: <20150826141709.24880.70822@loki> (raw)
In-Reply-To: <1440561851-17553-1-git-send-email-bharata@linux.vnet.ibm.com>

Quoting Bharata B Rao (2015-08-25 23:04:11)
> If drmgr is used in the guest to hotplug a device before a device_add
> has been issued via the QEMU monitor, QEMU segfaults in configure_connector
> call. This occurs due to accessing of NULL FDT which otherwise would have
> been created and associated with the DRC during device_add command.
> 
> Check for NULL FDT and return failure from configure_connector call.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Cc: Michael Roth <mdroth@linux.vnet.ibm.com>

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>

> ---
> Not fully sure if RTAS_OUT_HW_ERROR is the right error code here. Should
> we be using RTAS_OUT_NOT_SUPPORTED instead ?
> 
>  hw/ppc/spapr_rtas.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index e99e25f..3be8eec 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -522,6 +522,12 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
> 
>      drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
>      fdt = drck->get_fdt(drc, NULL);
> +    if (!fdt) {
> +        DPRINTF("rtas_ibm_configure_connector: Missing FDT for DRC index: %xh\n",
> +                drc_index);
> +        rc = RTAS_OUT_HW_ERROR;
> +        goto out;
> +    }
> 
>      ccs = spapr_ccs_find(spapr, drc_index);
>      if (!ccs) {
> -- 
> 2.1.0
> 

  reply	other threads:[~2015-08-26 14:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  4:04 [Qemu-devel] [FIX PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add Bharata B Rao
2015-08-26 14:17 ` Michael Roth [this message]
2015-08-27  5:28   ` Bharata B Rao
2015-08-28 20:43     ` Michael Roth

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=20150826141709.24880.70822@loki \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.