diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2018-12617.patch | 53 |
1 files changed, 53 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 | |||