From: Alex Williamson <alex.williamson@redhat.com>
To: anthony@redhat.com
Cc: Peter Maydell <peter.maydell@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/4] pci-assign: Fix potential read beyond buffer on -EBUSY
Date: Wed, 26 Feb 2014 11:26:00 -0700 [thread overview]
Message-ID: <20140226182600.8018.17416.stgit@bling.home> (raw)
In-Reply-To: <20140226182246.8018.81349.stgit@bling.home>
From: Markus Armbruster <armbru@redhat.com>
readlink() doesn't write a terminating null byte.
assign_failed_examine() passes the unterminated string to strrchr().
Oops. Terminate it.
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/i386/kvm/pci-assign.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 9686801..a825871 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -743,6 +743,7 @@ static void assign_failed_examine(AssignedDevice *dev)
goto fail;
}
+ driver[r] = 0;
ns = strrchr(driver, '/');
if (!ns) {
goto fail;
next prev parent reply other threads:[~2014-02-26 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 18:25 [Qemu-devel] [PULL 0/4] vfio update and fix + pci-assign fix Alex Williamson
2014-02-26 18:25 ` [Qemu-devel] [PULL 1/4] vfio: Fix overrun after readlink() fills buffer completely Alex Williamson
2014-02-26 18:26 ` Alex Williamson [this message]
2014-02-26 18:26 ` [Qemu-devel] [PULL 3/4] qdev-monitor: set DeviceState opts before calling realize Alex Williamson
2014-02-26 18:26 ` [Qemu-devel] [PULL 4/4] vfio: blacklist loading of unstable roms Alex Williamson
2014-02-26 18:29 ` [Qemu-devel] [PULL 0/4] vfio update and fix + pci-assign fix Alex Williamson
2014-02-27 11:51 ` 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=20140226182600.8018.17416.stgit@bling.home \
--to=alex.williamson@redhat.com \
--cc=anthony@redhat.com \
--cc=armbru@redhat.com \
--cc=peter.maydell@linaro.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).