Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
qemu-testsuite.19028
0121-9pfs-add-cleanup-operation-for-prox.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0121-9pfs-add-cleanup-operation-for-prox.patch of Package qemu-testsuite.19028
From: Li Qiang <liq3ea@gmail.com> Date: Wed, 23 Nov 2016 13:53:34 +0100 Subject: 9pfs: add cleanup operation for proxy backend driver In the init operation of proxy backend dirver, it allocates a V9fsProxy struct and some other resources. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Greg Kurz <groug@kaod.org> (cherry picked from commit 898ae90a44551d25b8e956fd87372d303c82fe68) [BR: CVE-2016-9913 BSC#1014110] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/9pfs/9p-proxy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 00a4eb2a7bcf5b4b4ecdf1e5fffa..7c6aaf390a78bb0cd986080386ac 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1181,9 +1181,22 @@ static int proxy_init(FsContext *ctx) return 0; } +static void proxy_cleanup(FsContext *ctx) +{ + V9fsProxy *proxy = ctx->private; + + g_free(proxy->out_iovec.iov_base); + g_free(proxy->in_iovec.iov_base); + if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { + close(proxy->sockfd); + } + g_free(proxy); +} + FileOperations proxy_ops = { .parse_opts = proxy_parse_opts, .init = proxy_init, + .cleanup = proxy_cleanup, .lstat = proxy_lstat, .readlink = proxy_readlink, .close = proxy_close,
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