All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH][zeus 13/18] qemu/slirp: fix CVE-2020-7211
Date: Tue,  5 May 2020 14:56:48 +0800	[thread overview]
Message-ID: <c68323151b9bafb5f52dda6a4bd11712feff2e83.1588661196.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1588661196.git.anuj.mittal@intel.com>

From: Chee Yang Lee <chee.yang.lee@intel.com>

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)

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>
---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 .../qemu/qemu/CVE-2020-7211.patch             | 46 +++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-7211.patch

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 \
            file://CVE-2020-7039-1.patch \
            file://CVE-2020-7039-2.patch \
            file://CVE-2020-7039-3.patch \
+	   file://CVE-2020-7211.patch \
 	   "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
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 @@
+From 14ec36e107a8c9af7d0a80c3571fe39b291ff1d4 Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Mon, 13 Jan 2020 17:44:31 +0530
+Subject: [PATCH] slirp: tftp: restrict relative path access
+
+tftp restricts relative or directory path access on Linux systems.
+Apply same restrictions on Windows systems too. It helps to avoid
+directory traversal issue.
+
+Fixes: https://bugs.launchpad.net/qemu/+bug/1812451
+Reported-by: Peter Maydell <peter.maydell@linaro.org>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Message-Id: <20200113121431.156708-1-ppandit@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/slirp/libslirp/-/commit/14ec36e107a8c9af7d0a80c3571fe39b291ff1d4.patch]
+CVE: CVE-2020-7211
+Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
+
+---
+ slirp/src/tftp.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/slirp/src/tftp.c b/slirp/src/tftp.c
+index 093c2e0..e52e71b 100644
+--- a/slirp/src/tftp.c
++++ b/slirp/src/tftp.c
+@@ -344,8 +344,13 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas,
+     k += 6; /* skipping octet */
+ 
+     /* do sanity checks on the filename */
+-    if (!strncmp(req_fname, "../", 3) ||
+-        req_fname[strlen(req_fname) - 1] == '/' || strstr(req_fname, "/../")) {
++    if (
++#ifdef G_OS_WIN32
++        strstr(req_fname, "..\\") ||
++        req_fname[strlen(req_fname) - 1] == '\\' ||
++#endif
++        strstr(req_fname, "../") ||
++        req_fname[strlen(req_fname) - 1] == '/') {
+         tftp_send_error(spt, 2, "Access violation", tp);
+         return;
+     }
+-- 
+2.24.1
+
-- 
2.25.4


  parent reply	other threads:[~2020-05-05  6:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  6:56 [PATCH][zeus 00/18] zeus patch review Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 01/18] python3-native: Should not search the system for headers/libraries Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 02/18] qemu: Replace stime() API with clock_settime Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 03/18] prservice.py: fix do_package with newer Python in Ubuntu 20.04 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 04/18] apt-native: don't let dpkg overwrite files by default Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 05/18] glibc: CVE-2020-1751 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 06/18] git: Security Advisory - git - CVE-2020-5260 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 07/18] git: Security Advisory - git - CVE-2020-11008 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 08/18] cve-update-db-native: clean DB if temporary file exist Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 09/18] qemu: Add PACKAGECONFIG for glusterfs Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 10/18] gnupg: upgrade 2.2.17 -> 2.2.19 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 11/18] python: Upgrade 2.7.17 -> 2.17.18 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 12/18] qemu: fix CVE-2020-7039 Anuj Mittal
2020-05-05  6:56 ` Anuj Mittal [this message]
2020-05-05  6:56 ` [PATCH][zeus 14/18] gnutls: upgrade 3.6.8 -> 3.6.11.1 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 15/18] gnutls: upgrade 3.6.11.1 -> 3.6.12 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 16/18] gnutls: upgrade 3.6.12 -> 3.6.13 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 17/18] systemd: Fix CVE-2020-1712 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 18/18] openssl: upgrade 1.1.1f -> 1.1.1g Anuj Mittal
2020-05-05  7:02 ` ✗ patchtest: failure for zeus patch review Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c68323151b9bafb5f52dda6a4bd11712feff2e83.1588661196.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.