diff options
| author | Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> | 2018-08-22 17:11:47 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-29 15:23:51 +0100 |
| commit | d82d8d431544225d7f664b16dd34878d71e86a4f (patch) | |
| tree | 440df7d34937728b34d8d99ebc34312c6bd1621c | |
| parent | 2ef1650794724a6cd6b0a6ac44024bbc8ed824a6 (diff) | |
| download | poky-d82d8d431544225d7f664b16dd34878d71e86a4f.tar.gz | |
qemu: CVE-2018-12617
qga: check bytes count read by guest-file-read
While reading file content via 'guest-file-read' command,
'qmp_guest_file_read' routine allocates buffer of count+1
bytes. It could overflow for large values of 'count'.
Add check to avoid it.
Affects qemu < v3.0.0
(From OE-Core rev: a11c8ee86007f7f7a34b9dc29d01acc323b71873)
Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch | 53 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu_2.11.1.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch b/meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch new file mode 100644 index 0000000000..c89f189824 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | From 141b197408ab398c4f474ac1a728ab316e921f2b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
| 3 | Date: Wed, 13 Jun 2018 11:46:57 +0530 | ||
| 4 | Subject: [PATCH] qga: check bytes count read by guest-file-read | ||
| 5 | |||
| 6 | While reading file content via 'guest-file-read' command, | ||
| 7 | 'qmp_guest_file_read' routine allocates buffer of count+1 | ||
| 8 | bytes. It could overflow for large values of 'count'. | ||
| 9 | Add check to avoid it. | ||
| 10 | |||
| 11 | Reported-by: Fakhri Zulkifli <mohdfakhrizulkifli@gmail.com> | ||
| 12 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
| 13 | Cc: qemu-stable@nongnu.org | ||
| 14 | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> | ||
| 15 | |||
| 16 | CVE: CVE-2018-12617 | ||
| 17 | Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commitdiff;h=141b197408ab398c4f474ac1a728ab316e921f2b] | ||
| 18 | |||
| 19 | Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> | ||
| 20 | --- | ||
| 21 | qga/commands-posix.c | 2 +- | ||
| 22 | qga/commands-win32.c | 2 +- | ||
| 23 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c | ||
| 26 | index 594d21ef3e..9284e71666 100644 | ||
| 27 | --- a/qga/commands-posix.c | ||
| 28 | +++ b/qga/commands-posix.c | ||
| 29 | @@ -458,7 +458,7 @@ struct GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count, | ||
| 30 | |||
| 31 | if (!has_count) { | ||
| 32 | count = QGA_READ_COUNT_DEFAULT; | ||
| 33 | - } else if (count < 0) { | ||
| 34 | + } else if (count < 0 || count >= UINT32_MAX) { | ||
| 35 | error_setg(errp, "value '%" PRId64 "' is invalid for argument count", | ||
| 36 | count); | ||
| 37 | return NULL; | ||
| 38 | diff --git a/qga/commands-win32.c b/qga/commands-win32.c | ||
| 39 | index 70ee5379f6..73f31fa8c2 100644 | ||
| 40 | --- a/qga/commands-win32.c | ||
| 41 | +++ b/qga/commands-win32.c | ||
| 42 | @@ -318,7 +318,7 @@ GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count, | ||
| 43 | } | ||
| 44 | if (!has_count) { | ||
| 45 | count = QGA_READ_COUNT_DEFAULT; | ||
| 46 | - } else if (count < 0) { | ||
| 47 | + } else if (count < 0 || count >= UINT32_MAX) { | ||
| 48 | error_setg(errp, "value '%" PRId64 | ||
| 49 | "' is invalid for argument count", count); | ||
| 50 | return NULL; | ||
| 51 | -- | ||
| 52 | 2.13.3 | ||
| 53 | |||
diff --git a/meta/recipes-devtools/qemu/qemu_2.11.1.bb b/meta/recipes-devtools/qemu/qemu_2.11.1.bb index db7ead7682..a447dc7196 100644 --- a/meta/recipes-devtools/qemu/qemu_2.11.1.bb +++ b/meta/recipes-devtools/qemu/qemu_2.11.1.bb | |||
| @@ -25,6 +25,7 @@ SRC_URI = "http://wiki.qemu-project.org/download/${BP}.tar.bz2 \ | |||
| 25 | file://0013-ps2-check-PS2Queue-pointers-in-post_load-routine.patch \ | 25 | file://0013-ps2-check-PS2Queue-pointers-in-post_load-routine.patch \ |
| 26 | file://0001-CVE-2018-11806-QEMU-slirp-heap-buffer-overflow.patch \ | 26 | file://0001-CVE-2018-11806-QEMU-slirp-heap-buffer-overflow.patch \ |
| 27 | file://CVE-2018-7550.patch \ | 27 | file://CVE-2018-7550.patch \ |
| 28 | file://CVE-2018-12617.patch \ | ||
| 28 | " | 29 | " |
| 29 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+\..*)\.tar" | 30 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+\..*)\.tar" |
| 30 | 31 | ||
