[pve-devel] [stable-3 kvm] hmp: fix sendkey out of bounds write (CVE-2015-8619)

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jan 11 09:59:18 CET 2016


---
 .../CVE-2015-8619-hmp-sendkey-oob-fix.patch        | 44 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 debian/patches/CVE-2015-8619-hmp-sendkey-oob-fix.patch

diff --git a/debian/patches/CVE-2015-8619-hmp-sendkey-oob-fix.patch b/debian/patches/CVE-2015-8619-hmp-sendkey-oob-fix.patch
new file mode 100644
index 0000000..78aea0c
--- /dev/null
+++ b/debian/patches/CVE-2015-8619-hmp-sendkey-oob-fix.patch
@@ -0,0 +1,44 @@
+From 8da4a3bf8fb076314f986a0d58cb94f5458e3659 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller at proxmox.com>
+Date: Mon, 11 Jan 2016 08:21:25 +0100
+Subject: [PATCH] hmp: fix sendkey out of bounds write (CVE-2015-8619)
+
+When processing 'sendkey' command, hmp_sendkey routine null
+terminates the 'keyname_buf' array. This results in an OOB
+write issue, if 'keyname_len' was to fall outside of
+'keyname_buf' array.
+
+Now checking the length against the buffer size before using
+it.
+
+Reported-by: Ling Liu <liuling-it at 360.cn>
+Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
+---
+ hmp.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hmp.c b/hmp.c
+index c2b2c16..0c7a04c 100644
+--- a/hmp.c
++++ b/hmp.c
+@@ -1749,6 +1749,8 @@ void hmp_sendkey(Monitor *mon, const QDict *qdict)
+     while (1) {
+         separator = strchr(keys, '-');
+         keyname_len = separator ? separator - keys : strlen(keys);
++        if (keyname_len >= sizeof(keyname_buf))
++            goto err_out;
+         pstrcpy(keyname_buf, sizeof(keyname_buf), keys);
+ 
+         /* Be compatible with old interface, convert user inputted "<" */
+@@ -1800,7 +1802,7 @@ out:
+     return;
+ 
+ err_out:
+-    monitor_printf(mon, "invalid parameter: %s\n", keyname_buf);
++    monitor_printf(mon, "invalid parameter: %s\n", keys);
+     goto out;
+ }
+ 
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 813fbdb..868bfd4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -50,3 +50,4 @@ CVE-2015-8666-acpi-fix-buffer-overrun-on-migration.patch
 CVE-2015-8743-ne2000-ioport-bounds-check.patch
 CVE-2015-8744-vmxnet3-refine-l2-header-validation.patch
 CVE-2015-8745-vmxnet3-support-reading-imr-registers.patch
+CVE-2015-8619-hmp-sendkey-oob-fix.patch
-- 
2.1.4





More information about the pve-devel mailing list