Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
xen.2959
xsa178-0005-libxl-cdrom-eject-and-insert-write-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa178-0005-libxl-cdrom-eject-and-insert-write-to-libxl.patch of Package xen.2959
References: bsc#979670 CVE-2016-4963 XSA-178 From d637ba5a50f3c654f5caa7c251e623cace1640f8 Mon Sep 17 00:00:00 2001 From: Ian Jackson <ian.jackson@eu.citrix.com> Date: Fri, 29 Apr 2016 19:15:13 +0100 Subject: [PATCH 05/21] libxl: cdrom eject and insert: write to /libxl Copy the new type and params values to /libxl, so that the information in /libxl is kept up to date. This is needed so that we can return this trustworthy information, rather than trusting the backend-writeable parts of xenstore. This is part of XSA-178. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) Index: xen-4.5.3-testing/tools/libxl/libxl.c =================================================================== --- xen-4.5.3-testing.orig/tools/libxl/libxl.c +++ xen-4.5.3-testing/tools/libxl/libxl.c @@ -2856,7 +2856,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u libxl_domain_config d_config; int rc, dm_ver; libxl__device device; - const char * path; + const char *path, *libxl_path; char * tmp; libxl__domain_userdata_lock *lock = NULL; xs_transaction_t t = XBT_NULL; @@ -2924,6 +2924,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u if (rc) goto out; path = libxl__device_backend_path(gc, &device); + libxl_path = libxl__device_libxl_path(gc, &device); insert = flexarray_make(gc, 4, 1); @@ -2972,8 +2973,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u goto out; } - rc = libxl__xs_writev(gc, t, path, - libxl__xs_kvs_of_flexarray(gc, empty, empty->count)); + char **kvs = libxl__xs_kvs_of_flexarray(gc, empty, empty->count); + + rc = libxl__xs_writev(gc, t, path, kvs); + if (rc) goto out; + + rc = libxl__xs_writev(gc, t, libxl_path, kvs); if (rc) goto out; rc = libxl__xs_transaction_commit(gc, &t); @@ -3007,8 +3012,12 @@ int libxl_cdrom_insert(libxl_ctx *ctx, u rc = libxl__set_domain_configuration(gc, domid, &d_config); if (rc) goto out; - rc = libxl__xs_writev(gc, t, path, - libxl__xs_kvs_of_flexarray(gc, insert, insert->count)); + char **kvs = libxl__xs_kvs_of_flexarray(gc, insert, insert->count); + + rc = libxl__xs_writev(gc, t, path, kvs); + if (rc) goto out; + + rc = libxl__xs_writev(gc, t, libxl_path, kvs); if (rc) goto out; rc = libxl__xs_transaction_commit(gc, &t);
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