[PATCH v3] v2v: don't fail when virtio-win does not have qemu-ga
by Richard W.M. Jones
Sorry, there was a small mistake in v2 of the patch. The difference
between v2 & v3 is below. All my other comments in the cover letter
of v2 also apply here.
Rich.
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -293,8 +293,7 @@ and copy_drivers g inspect driverdir =
[] <> copy_from_virtio_win g inspect "/" driverdir
virtio_iso_path_matches_guest_os
(fun () ->
- error "driver directory ‘%s’ is missing from the virtio-win directory or ISO.\n\nThis should not happen and may indicate that virtio-win or virt-v2v is broken in some way. Please report this as a bug with a full debug log."
- driverdir)
+ error "root directory ‘/’ is missing from the virtio-win directory or ISO.\n\nThis should not happen and may indicate that virtio-win or virt-v2v is broken in some way. Please report this as a bug with a full debug log.")
(* Copy all files from virtio_win directory/ISO located in [srcdir]
* subdirectory and all its subdirectories to the [destdir]. The directory
5 years, 11 months
[PATCH v2] v2v: don't fail when virtio-win does not have qemu-ga
by Richard W.M. Jones
This is my version of this patch which I think improves it in a number
of ways. Firstly instead of having the bare boolean parameter
‘ok_if_missing’ we pass in the function we want to call along the
directory missing path.
This change then allows us to print a more useful error or warning
message given the context of the call, and the new message is
actionable too, so the user knows what has to be done to correct the
problem.
The other changes are all whitespace.
This is only compile tested, please see if it fixes the problem in the
slow tests.
Rich.
5 years, 11 months
[PATCH] v2v: don't fail when virtio-win does not have qemu-ga packages
by Tomáš Golembiovský
It should not be error to use virtio-win ISO that does not have Linux
packages of QEMU Guest Agent. Only oVirt/RHV guest tools ISO has such
packages now. Regular virtio-win ISO does not have them and maybe never
will.
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/windows_virtio.ml | 88 +++++++++++++++++++++++++++----------------
1 file changed, 55 insertions(+), 33 deletions(-)
diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml
index 0b9bdfff3..9972e8c88 100644
--- a/v2v/windows_virtio.ml
+++ b/v2v/windows_virtio.ml
@@ -205,7 +205,7 @@ and install_linux_tools g inspect =
let dst_path = "/var/tmp" in
debug "locating packages in %s" src_path;
let packages = copy_from_virtio_win g inspect src_path dst_path
- (fun _ _ -> true) in
+ (fun _ _ -> true) true in
debug "done copying %d files" (List.length packages);
let packages = List.map ((//) dst_path) packages in
try
@@ -286,36 +286,49 @@ and ddb_regedits inspect drv_name drv_pciid =
* been copied.
*)
and copy_drivers g inspect driverdir =
- [] <> copy_from_virtio_win g inspect "/" driverdir virtio_iso_path_matches_guest_os
+ [] <> copy_from_virtio_win g inspect "/" driverdir
+ virtio_iso_path_matches_guest_os false
(* Copy all files from virtio_win directory/ISO located in [srcdir]
* subdirectory and all its subdirectories to the [destdir]. The directory
* hierarchy is not preserved, meaning all files will be directly in [destdir].
* The file list is filtered based on [filter] function.
*
+ * If [ok_if_missing] is true only warn when [srcdir] is missing, fail with an
+ * error if false.
+ *
* Returns list of copied files.
*)
-and copy_from_virtio_win g inspect srcdir destdir filter =
+and copy_from_virtio_win g inspect srcdir destdir filter ok_if_missing =
let ret = ref [] in
if is_directory virtio_win then (
let dir = virtio_win // srcdir in
debug "windows: copy_from_virtio_win: guest tools source directory %s" dir;
- let cmd = sprintf "cd %s && find -L -type f" (quote dir) in
- let paths = external_command cmd in
- List.iter (
- fun path ->
- if filter path inspect then (
- let source = dir // path in
- let target_name = String.lowercase_ascii (Filename.basename path) in
- let target = destdir // target_name in
- debug "windows: copying guest tools bits: 'host:%s' -> '%s'"
- source target;
-
- g#write target (read_whole_file source);
- List.push_front target_name ret
- )
- ) paths
+ if not (is_directory srcdir) then (
+ let msg = f_"cannot locate directory '%s' in virtio-win directory" in
+ if ok_if_missing then (
+ warning msg srcdir;
+ )
+ else
+ error msg srcdir
+ ) else (
+ let cmd = sprintf "cd %s && find -L -type f" (quote dir) in
+ let paths = external_command cmd in
+ List.iter (
+ fun path ->
+ if filter path inspect then (
+ let source = dir // path in
+ let target_name = String.lowercase_ascii (Filename.basename path) in
+ let target = destdir // target_name in
+ debug "windows: copying guest tools bits: 'host:%s' -> '%s'"
+ source target;
+
+ g#write target (read_whole_file source);
+ List.push_front target_name ret
+ )
+ ) paths
+ )
)
else if is_regular_file virtio_win then (
debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;
@@ -327,21 +340,30 @@ and copy_from_virtio_win g inspect srcdir destdir filter =
let vio_root = "/" in
g2#mount_ro "/dev/sda" vio_root;
let srcdir = vio_root ^ "/" ^ srcdir in
- let paths = g2#find srcdir in
- Array.iter (
- fun path ->
- let source = srcdir ^ "/" ^ path in
- if g2#is_file source ~followsymlinks:false &&
- filter path inspect then (
- let target_name = String.lowercase_ascii (Filename.basename path) in
- let target = destdir ^ "/" ^ target_name in
- debug "windows: copying guest tools bits: '%s:%s' -> '%s'"
- virtio_win path target;
-
- g#write target (g2#read_file source);
- List.push_front target_name ret
- )
- ) paths;
+ if not (g2#is_dir srcdir) then (
+ let msg = f_"cannot locate directory '%s' in virtio-win ISO" in
+ if ok_if_missing then
+ warning msg srcdir
+ else
+ error msg srcdir
+ )
+ else (
+ let paths = g2#find srcdir in
+ Array.iter (
+ fun path ->
+ let source = srcdir ^ "/" ^ path in
+ if g2#is_file source ~followsymlinks:false &&
+ filter path inspect then (
+ let target_name = String.lowercase_ascii (Filename.basename path) in
+ let target = destdir ^ "/" ^ target_name in
+ debug "windows: copying guest tools bits: '%s:%s' -> '%s'"
+ virtio_win path target;
+
+ g#write target (g2#read_file source);
+ List.push_front target_name ret
+ )
+ ) paths;
+ );
g2#close()
with Guestfs.Error msg ->
error (f_"%s: cannot open virtio-win ISO file: %s") virtio_win msg
--
2.19.1
5 years, 11 months
nbdkit low priority security fix: TLS connections cause memory leak
by Richard W.M. Jones
As you may have seen if you've been following discussions on the
mailing list, we discovered a low priority security problem with
nbdkit's handling of TLS connections.
If TLS is enabled without either client certificate validation or PSK,
untrusted clients can connect, negotiate the TLS handshake, disconnect
and leak about 14K of memory each time. So after tens of thousands to
millions of connections you can leak a substantial amount of memory,
likely resulting in nbdkit crashing, thus a denial of service attack.
TLS is enabled by default only if certificates are available. Both
client certificate validation and PSK are disabled by default. So the
server can default to being vulnerable once you've created
certificates, although it is probably not vulnerable in out of the box
configurations because I don't know any Linux distro which is
automatically creating TLS certs for nbdkit.
The upstream fix is:
https://github.com/libguestfs/nbdkit/commit/baf10918f94b84185a27b4bb81cf3...
This has been backported to all stable branches, and is also available
in the following released versions:
nbdkit >= 1.9.4
nbdkit >= 1.8.2
nbdkit >= 1.6.4
nbdkit >= 1.4.4
nbdkit >= 1.2.8
all available here: http://download.libguestfs.org/nbdkit/
I'm making updated packages available for Fedora now.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
5 years, 11 months
[PATCH nbdkit 0/4] Multiple valgrind improvements and possible security fix.
by Richard W.M. Jones
I worked out why valgrind wasn't being applied to nbdkit when run by
many of the tests (patches 1-2). Unfortunately I'm not able to make
it actually fail tests when valgrind fails. Although the situation is
marginally improved in that you can now manually examine the *.log
files and find valgrind failures that way. Also adds valgrinding of
the Python plugin (patch 3).
Along the way I found that when we create a TLS session object we
never free it, which is a bit of a problem (although easy to fix -
patch 4).
I'll need to backport this fix to every stable branch. It's not clear
how exploitable this is -- it's my feeling that you'd need to open
millions of TLS sessions which would take forever, and the result
would only be a denial of service as nbdkit runs out of memory and
crashes.
Rich.
5 years, 11 months
[supermin PATCH 0/2] Create a really empty base.tar.gz
by Pino Toscano
See patch #2 for more explanation.
Pino Toscano (2):
prepare: keep config_files available for longer
prepare: create a really empty base.tar.gz with no config files
src/mode_prepare.ml | 87 +++++++++++++++++++++++++++------------------
1 file changed, 52 insertions(+), 35 deletions(-)
--
2.17.2
5 years, 11 months