diff options
| author | Chee Yang Lee <chee.yang.lee@intel.com> | 2020-05-02 00:41:13 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-07 17:32:09 +0100 |
| commit | 887f299ce983eaf4798b44a8808f2731be68cbe3 (patch) | |
| tree | b8d07485611687bbc7b55ff10839596b9d809267 | |
| parent | 76f72ee8a9239d36e45a4883048371081b8a6bca (diff) | |
| download | poky-887f299ce983eaf4798b44a8808f2731be68cbe3.tar.gz | |
qemu/slirp: fix CVE-2020-7211
fix CVE-2020-7211 for qemu slirp submodule
see :
https://www.openwall.com/lists/oss-security/2020/01/17/2
https://gitlab.freedesktop.org/slirp/libslirp/commit/14ec36e107a8c9af7d0a80c3571fe39b291ff1d4
(From OE-Core rev: 31362d739834377ac4ab880029c3e3dda0cd7698)
(From OE-Core rev: c68323151b9bafb5f52dda6a4bd11712feff2e83)
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 22cb10b1c2..ba31c3ba60 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -35,6 +35,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
| 35 | file://CVE-2020-7039-1.patch \ | 35 | file://CVE-2020-7039-1.patch \ |
| 36 | file://CVE-2020-7039-2.patch \ | 36 | file://CVE-2020-7039-2.patch \ |
| 37 | file://CVE-2020-7039-3.patch \ | 37 | file://CVE-2020-7039-3.patch \ |
| 38 | file://CVE-2020-7211.patch \ | ||
| 38 | " | 39 | " |
| 39 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 40 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 40 | 41 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch new file mode 100644 index 0000000000..11be4c92e7 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 14ec36e107a8c9af7d0a80c3571fe39b291ff1d4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
| 3 | Date: Mon, 13 Jan 2020 17:44:31 +0530 | ||
| 4 | Subject: [PATCH] slirp: tftp: restrict relative path access | ||
| 5 | |||
| 6 | tftp restricts relative or directory path access on Linux systems. | ||
| 7 | Apply same restrictions on Windows systems too. It helps to avoid | ||
| 8 | directory traversal issue. | ||
| 9 | |||
| 10 | Fixes: https://bugs.launchpad.net/qemu/+bug/1812451 | ||
| 11 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | ||
| 12 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
| 13 | Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> | ||
| 14 | Message-Id: <20200113121431.156708-1-ppandit@redhat.com> | ||
| 15 | |||
| 16 | Upstream-Status: Backport [https://gitlab.freedesktop.org/slirp/libslirp/-/commit/14ec36e107a8c9af7d0a80c3571fe39b291ff1d4.patch] | ||
| 17 | CVE: CVE-2020-7211 | ||
| 18 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
| 19 | |||
| 20 | --- | ||
| 21 | slirp/src/tftp.c | 9 +++++++-- | ||
| 22 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/slirp/src/tftp.c b/slirp/src/tftp.c | ||
| 25 | index 093c2e0..e52e71b 100644 | ||
| 26 | --- a/slirp/src/tftp.c | ||
| 27 | +++ b/slirp/src/tftp.c | ||
| 28 | @@ -344,8 +344,13 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, | ||
| 29 | k += 6; /* skipping octet */ | ||
| 30 | |||
| 31 | /* do sanity checks on the filename */ | ||
| 32 | - if (!strncmp(req_fname, "../", 3) || | ||
| 33 | - req_fname[strlen(req_fname) - 1] == '/' || strstr(req_fname, "/../")) { | ||
| 34 | + if ( | ||
| 35 | +#ifdef G_OS_WIN32 | ||
| 36 | + strstr(req_fname, "..\\") || | ||
| 37 | + req_fname[strlen(req_fname) - 1] == '\\' || | ||
| 38 | +#endif | ||
| 39 | + strstr(req_fname, "../") || | ||
| 40 | + req_fname[strlen(req_fname) - 1] == '/') { | ||
| 41 | tftp_send_error(spt, 2, "Access violation", tp); | ||
| 42 | return; | ||
| 43 | } | ||
| 44 | -- | ||
| 45 | 2.24.1 | ||
| 46 | |||
