Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.12301
0184-9pfs-PDU-processing-functions-shoul.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0184-9pfs-PDU-processing-functions-shoul.patch of Package qemu.12301
From 9194fb0c8045b3ce41f3f3573ec672ee1341fa38 Mon Sep 17 00:00:00 2001 From: Wei Liu <wei.liu2@citrix.com> Date: Wed, 2 Dec 2015 15:00:14 +0000 Subject: [PATCH] 9pfs: PDU processing functions should start pdu_ prefix This matches naming convention of pdu_marshal and pdu_unmarshal. 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 dc295f83538e936895c0e26d817b1a123c384c82) [BR: Fix and/or infrastructure for BSC#1020427 CVE-2016-9602] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/9pfs/virtio-9p.c | 88 ++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 6408d37736..67b8db7011 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -561,7 +561,7 @@ static int fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, V9fsQID *qidp) return 0; } -static V9fsPDU *alloc_pdu(V9fsState *s) +static V9fsPDU *pdu_alloc(V9fsState *s) { V9fsPDU *pdu = NULL; @@ -573,7 +573,7 @@ static V9fsPDU *alloc_pdu(V9fsState *s) return pdu; } -static void free_pdu(V9fsPDU *pdu) +static void pdu_free(V9fsPDU *pdu) { if (pdu) { V9fsState *s = pdu->s; @@ -593,7 +593,7 @@ static void free_pdu(V9fsPDU *pdu) * because we always expect to have enough space to encode * error details */ -static void complete_pdu(V9fsPDU *pdu, ssize_t len) +static void pdu_complete(V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ V9fsState *s = pdu->s; @@ -636,7 +636,7 @@ static void complete_pdu(V9fsPDU *pdu, ssize_t len) /* Now wakeup anybody waiting in flush for this request */ qemu_co_queue_next(&pdu->complete); - free_pdu(pdu); + pdu_free(pdu); } static mode_t v9mode_to_mode(uint32_t mode, V9fsString *extension) @@ -931,7 +931,7 @@ static void v9fs_version(void *opaque) offset += err; trace_v9fs_version_return(pdu->tag, pdu->id, s->msize, version.data); out: - complete_pdu(pdu, offset); + pdu_complete(pdu, offset); v9fs_string_free(&version); } @@ -995,7 +995,7 @@ static void v9fs_attach(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&uname); v9fs_string_free(&aname); } @@ -1041,7 +1041,7 @@ static void v9fs_stat(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static void v9fs_getattr(void *opaque) @@ -1104,7 +1104,7 @@ static void v9fs_getattr(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, retval); + pdu_complete(pdu, retval); } /* Attribute flags */ @@ -1201,7 +1201,7 @@ static void v9fs_setattr(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids) @@ -1243,7 +1243,7 @@ static void v9fs_walk(void *opaque) err = pdu_unmarshal(pdu, offset, "ddw", &fid, &newfid, &nwnames); if (err < 0) { - complete_pdu(pdu, err); + pdu_complete(pdu, err); return ; } offset += err; @@ -1311,7 +1311,7 @@ out: v9fs_path_free(&dpath); v9fs_path_free(&path); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); if (nwnames && nwnames <= P9_MAXWELEM) { for (name_idx = 0; name_idx < nwnames; name_idx++) { v9fs_string_free(&wnames[name_idx]); @@ -1428,7 +1428,7 @@ static void v9fs_open(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static void v9fs_lcreate(void *opaque) @@ -1485,7 +1485,7 @@ static void v9fs_lcreate(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -1515,7 +1515,7 @@ static void v9fs_fsync(void *opaque) } put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static void v9fs_clunk(void *opaque) @@ -1548,7 +1548,7 @@ static void v9fs_clunk(void *opaque) err = offset; } out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, @@ -1758,7 +1758,7 @@ static void v9fs_read(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static size_t v9fs_readdir_data_size(V9fsString *name) @@ -1881,7 +1881,7 @@ static void v9fs_readdir(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, retval); + pdu_complete(pdu, retval); } static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, @@ -1948,7 +1948,7 @@ static void v9fs_write(void *opaque) err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &count); if (err < 0) { - complete_pdu(pdu, err); + pdu_complete(pdu, err); return; } offset += err; @@ -2011,7 +2011,7 @@ out: put_fid(pdu, fidp); out_nofid: qemu_iovec_destroy(&qiov_full); - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static void v9fs_create(void *opaque) @@ -2178,7 +2178,7 @@ static void v9fs_create(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); v9fs_string_free(&extension); v9fs_path_free(&path); @@ -2225,7 +2225,7 @@ static void v9fs_symlink(void *opaque) out: put_fid(pdu, dfidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); v9fs_string_free(&symname); } @@ -2241,7 +2241,7 @@ static void v9fs_flush(void *opaque) err = pdu_unmarshal(pdu, offset, "w", &tag); if (err < 0) { - complete_pdu(pdu, err); + pdu_complete(pdu, err); return; } trace_v9fs_flush(pdu->tag, pdu->id, tag); @@ -2258,9 +2258,9 @@ static void v9fs_flush(void *opaque) */ qemu_co_queue_wait(&cancel_pdu->complete); cancel_pdu->cancelled = 0; - free_pdu(cancel_pdu); + pdu_free(cancel_pdu); } - complete_pdu(pdu, 7); + pdu_complete(pdu, 7); } static void v9fs_link(void *opaque) @@ -2298,7 +2298,7 @@ out: put_fid(pdu, dfidp); out_nofid: v9fs_string_free(&name); - complete_pdu(pdu, err); + pdu_complete(pdu, err); } /* Only works with path name based fid */ @@ -2343,7 +2343,7 @@ out_err: clunk_fid(pdu->s, fidp->fid); put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static void v9fs_unlinkat(void *opaque) @@ -2387,7 +2387,7 @@ out_err: put_fid(pdu, dfidp); v9fs_path_free(&path); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -2487,7 +2487,7 @@ static void v9fs_rename(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -2588,7 +2588,7 @@ static void v9fs_renameat(void *opaque) } out_err: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&old_name); v9fs_string_free(&new_name); } @@ -2684,7 +2684,7 @@ out: put_fid(pdu, fidp); out_nofid: v9fs_stat_free(&v9stat); - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf) @@ -2763,7 +2763,7 @@ static void v9fs_statfs(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, retval); + pdu_complete(pdu, retval); } static void v9fs_mknod(void *opaque) @@ -2810,7 +2810,7 @@ static void v9fs_mknod(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -2867,7 +2867,7 @@ out_nofid: err += offset; } trace_v9fs_lock_return(pdu->tag, pdu->id, status); - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&flock.client_id); } @@ -2916,7 +2916,7 @@ static void v9fs_getlock(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&glock.client_id); } @@ -2960,7 +2960,7 @@ static void v9fs_mkdir(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -3066,7 +3066,7 @@ out: put_fid(pdu, xattr_fidp); } out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -3106,7 +3106,7 @@ static void v9fs_xattrcreate(void *opaque) err = offset; put_fid(pdu, file_fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); v9fs_string_free(&name); } @@ -3146,7 +3146,7 @@ static void v9fs_readlink(void *opaque) out: put_fid(pdu, fidp); out_nofid: - complete_pdu(pdu, err); + pdu_complete(pdu, err); } static CoroutineEntry *pdu_co_handlers[] = { @@ -3189,13 +3189,13 @@ static CoroutineEntry *pdu_co_handlers[] = { static void v9fs_op_not_supp(void *opaque) { V9fsPDU *pdu = opaque; - complete_pdu(pdu, -EOPNOTSUPP); + pdu_complete(pdu, -EOPNOTSUPP); } static void v9fs_fs_ro(void *opaque) { V9fsPDU *pdu = opaque; - complete_pdu(pdu, -EROFS); + pdu_complete(pdu, -EROFS); } static inline bool is_read_only_op(V9fsPDU *pdu) @@ -3225,7 +3225,7 @@ static inline bool is_read_only_op(V9fsPDU *pdu) } } -static void submit_pdu(V9fsPDU *pdu) +static void pdu_submit(V9fsPDU *pdu) { Coroutine *co; CoroutineEntry *handler; @@ -3251,7 +3251,7 @@ void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq) V9fsPDU *pdu; ssize_t len; - while ((pdu = alloc_pdu(s)) && + while ((pdu = pdu_alloc(s)) && (len = virtqueue_pop(vq, &pdu->elem)) != 0) { uint8_t *ptr; BUG_ON(pdu->elem.out_num == 0 || pdu->elem.in_num == 0); @@ -3263,9 +3263,9 @@ void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq) pdu->id = ptr[4]; pdu->tag = le16_to_cpu(*(uint16_t *)(ptr + 5)); qemu_co_queue_init(&pdu->complete); - submit_pdu(pdu); + pdu_submit(pdu); } - free_pdu(pdu); + pdu_free(pdu); } static void __attribute__((__constructor__)) virtio_9p_set_fd_limit(void)
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