Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
qemu.8405
0341-9pfs-break-out-virtio_init_iov_from.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0341-9pfs-break-out-virtio_init_iov_from.patch of Package qemu.8405
From 4b3f5481f7ee10d65899015ffa4fd9bf80a15baa Mon Sep 17 00:00:00 2001 From: Wei Liu <wei.liu2@citrix.com> Date: Thu, 3 Dec 2015 13:21:51 +0000 Subject: [PATCH] 9pfs: break out virtio_init_iov_from_pdu Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> (cherry picked from commit 592707af7f9e7098949adae6ebf2b065456e0773) [BR: Fix and/or infrastructure for BSC#1020427 CVE-2016-9602] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/9pfs/virtio-9p-device.c | 12 ++++++++++++ hw/9pfs/virtio-9p.c | 8 +------- hw/9pfs/virtio-9p.h | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index c2ada21957..7ad4e99b07 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -173,6 +173,18 @@ ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, offset, 1, fmt, ap); } +void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, + unsigned int *pniov, bool is_write) +{ + if (is_write) { + *piov = pdu->elem.out_sg; + *pniov = pdu->elem.out_num; + } else { + *piov = pdu->elem.in_sg; + *pniov = pdu->elem.in_num; + } +} + /* virtio-9p device */ static Property virtio_9p_properties[] = { diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index f35b9199f1..70f872fe8c 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -1696,13 +1696,7 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, struct iovec *iov; unsigned int niov; - if (is_write) { - iov = pdu->elem.out_sg; - niov = pdu->elem.out_num; - } else { - iov = pdu->elem.in_sg; - niov = pdu->elem.in_num; - } + virtio_init_iov_from_pdu(pdu, &iov, &niov, is_write); qemu_iovec_init_external(&elem, iov, niov); qemu_iovec_init(qiov, niov); diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index e298949fde..5024ad0460 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -327,6 +327,8 @@ ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap); ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap); +void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, + unsigned int *pniov, bool is_write); #define TYPE_VIRTIO_9P "virtio-9p-device" #define VIRTIO_9P(obj) \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor