All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>, Jason Wang <jasowang@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Fix crash with illegal "-net nic, model=xxx" option
Date: Sun, 12 Apr 2015 13:57:48 +0200	[thread overview]
Message-ID: <552A5DBC.7070903@suse.de> (raw)
In-Reply-To: <20150412131338-mutt-send-email-mst@redhat.com>

Am 12.04.2015 um 13:14 schrieb Michael S. Tsirkin:
> On Thu, Apr 09, 2015 at 03:48:57PM +0100, Peter Maydell wrote:
>> On 9 April 2015 at 14:37, Michael S. Tsirkin <mst@redhat.com> wrote:
>>> On Thu, Apr 09, 2015 at 03:32:45PM +0200, Thomas Huth wrote:
>>>> Current QEMU crashes when specifying an illegal model with the
>>>> "-net nic,model=xxx" option, e.g.:
>>>>
>>>>  $ qemu-system-x86_64 -net nic,model=n/a
>>>>  qemu-system-x86_64: Unsupported NIC model: n/a
>>>>
>>>>  Program received signal SIGSEGV, Segmentation fault.
>>>>
>>>> The gdb backtrace looks like this:
>>>>
>>>> 0x0000555555965fe0 in error_get_pretty (err=0x0) at util/error.c:152
>>>> 152       return err->msg;
>>>> (gdb) bt
>>>>  0  0x0000555555965fe0 in error_get_pretty (err=0x0) at util/error.c:152
>>>>  1  0x0000555555965ffd in error_report_err (err=0x0) at util/error.c:157
>>>>  2  0x0000555555809c90 in pci_nic_init_nofail (nd=0x555555e49860 <nd_table>, rootbus=0x5555564409b0,
>>>>     default_model=0x55555598c37b "e1000", default_devaddr=0x0) at hw/pci/pci.c:1663
>>>>  3  0x0000555555691e42 in pc_nic_init (isa_bus=0x555556f71900, pci_bus=0x5555564409b0)
>>>>     at hw/i386/pc.c:1506
>>>>  4  0x000055555569396b in pc_init1 (machine=0x5555562abbf0, pci_enabled=1, kvmclock_enabled=1)
>>>>     at hw/i386/pc_piix.c:248
>>>>  5  0x0000555555693d27 in pc_init_pci (machine=0x5555562abbf0) at hw/i386/pc_piix.c:310
>>>>  6  0x000055555572ddf5 in main (argc=3, argv=0x7fffffffe018, envp=0x7fffffffe038) at vl.c:4226
>>>>
>>>> The problem is that pci_nic_init_nofail() does not check whether the err
>>>> parameter from pci_nic_init has been set up and thus passes a NULL pointer
>>>> to error_report_err(). Fix it by correctly checking the err parameter.
>>>>
>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>
>>> Thanks!
>>> Given that this is a legacy -net option, I'm inclined
>>> to fix it post-2.3, and Cc stable.
>>> Unfortunately I won't be able to do a pull request before rc3.
>>
>> Since this is a pretty safe and simple change I'm happy to apply
>> it direct to master if you like. Do you want to provide a reviewed-by
>> tag?
> 
> I reviewed the patch, and sent a tag.
> I'm fine with you making the decision on whether it's
> appropriate for 2.3.

Hope you added a "pci:" topic? :)

Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)

  reply	other threads:[~2015-04-12 11:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 13:32 [Qemu-devel] [PATCH] Fix crash with illegal "-net nic, model=xxx" option Thomas Huth
2015-04-09 13:37 ` Michael S. Tsirkin
2015-04-09 14:48   ` Peter Maydell
2015-04-12 11:14     ` Michael S. Tsirkin
2015-04-12 11:57       ` Andreas Färber [this message]
2015-04-09 18:31 ` Eric Blake
2015-04-09 19:57   ` Paolo Bonzini
2015-04-27 11:48     ` Markus Armbruster
2015-04-27 15:19       ` Thomas Huth
2015-04-12 11:13 ` Michael S. Tsirkin
2015-04-13  3:01 ` Jason Wang
2015-04-13 11:28   ` Peter Maydell

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=552A5DBC.7070903@suse.de \
    --to=afaerber@suse.de \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /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.