From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/qdev: Fix NULL access when using BB twice
Date: Wed, 29 Jun 2016 11:51:45 +0200 [thread overview]
Message-ID: <20160629095145.GA4831@noname.redhat.com> (raw)
In-Reply-To: <1466667001-10167-1-git-send-email-kwolf@redhat.com>
Am 23.06.2016 um 09:30 hat Kevin Wolf geschrieben:
> BlockBackend has only a single pointer to its guest device, so it makes
> sure that only a single guest device is attached to it. device-add
> returns an error if you try to attach a second device to a BB. In order
> to make the error message nicer, -device that manually connects to a
> if=none block device get a different message than -drive that implicitly
> creates a guest device. The if=... option is stored in DriveInfo.
>
> However, since blockdev-add exists, not every BlockBackend has a
> DriveInfo any more. Check that it exists before we dereference it.
>
> QMP reproducer resulting in a segfault:
>
> {"execute":"blockdev-add","arguments":{"options":{"id":"disk","driver":"file","filename":"/tmp/test.img"}}}
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"disk"}}
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"disk"}}
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Applied to my block branch.
Kevin
prev parent reply other threads:[~2016-06-29 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 7:30 [Qemu-devel] [PATCH] block/qdev: Fix NULL access when using BB twice Kevin Wolf
2016-06-23 12:24 ` Eric Blake
2016-06-24 10:05 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-29 9:51 ` Kevin Wolf [this message]
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=20160629095145.GA4831@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--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).