public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 09/33] qemu: fix CVE-2020-13361
Date: Mon, 22 Jun 2020 07:58:03 -1000	[thread overview]
Message-ID: <0e4985236dd7d2e92576fb30b70bc434a7ecd367.1592848337.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1592848337.git.steve@sakoman.com>

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

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2dcef5dfb5c4c57fd793d04ac936a9ff73aae844)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 .../qemu/qemu/CVE-2020-13361.patch            | 61 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2020-13361.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 126e7d442c..3e5006937b 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -38,6 +38,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
 	   file://0001-qemu-Do-not-include-file-if-not-exists.patch \
            file://CVE-2020-11102.patch \
 	   file://CVE-2020-11869.patch \
+	   file://CVE-2020-13361.patch \
 	   "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2020-13361.patch b/meta/recipes-devtools/qemu/qemu/CVE-2020-13361.patch
new file mode 100644
index 0000000000..e0acc70f3c
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2020-13361.patch
@@ -0,0 +1,61 @@
+From 369ff955a8497988d079c4e3fa1e93c2570c1c69 Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Fri, 15 May 2020 01:36:08 +0530
+Subject: [PATCH] es1370: check total frame count against current frame
+
+A guest user may set channel frame count via es1370_write()
+such that, in es1370_transfer_audio(), total frame count
+'size' is lesser than the number of frames that are processed
+'cnt'.
+
+    int cnt = d->frame_cnt >> 16;
+    int size = d->frame_cnt & 0xffff;
+
+if (size < cnt), it results in incorrect calculations leading
+to OOB access issue(s). Add check to avoid it.
+
+Reported-by: Ren Ding <rding@gatech.edu>
+Reported-by: Hanqing Zhao <hanqing@gatech.edu>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Message-id: 20200514200608.1744203-1-ppandit@redhat.com
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+
+Upstream-Status: Backport [https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg03983.html]
+CVE: CVE-2020-13361
+Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
+---
+ hw/audio/es1370.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
+index 89c4dabcd44..5f8a83ff562 100644
+--- a/hw/audio/es1370.c
++++ b/hw/audio/es1370.c
+@@ -643,6 +643,9 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
+     int csc_bytes = (csc + 1) << d->shift;
+     int cnt = d->frame_cnt >> 16;
+     int size = d->frame_cnt & 0xffff;
++    if (size < cnt) {
++        return;
++    }
+     int left = ((size - cnt + 1) << 2) + d->leftover;
+     int transferred = 0;
+     int temp = MIN (max, MIN (left, csc_bytes));
+@@ -651,7 +654,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
+     addr += (cnt << 2) + d->leftover;
+ 
+     if (index == ADC_CHANNEL) {
+-        while (temp) {
++        while (temp > 0) {
+             int acquired, to_copy;
+ 
+             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
+@@ -669,7 +672,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
+     else {
+         SWVoiceOut *voice = s->dac_voice[index];
+ 
+-        while (temp) {
++        while (temp > 0) {
+             int copied, to_copy;
+ 
+             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
-- 
2.17.1


  parent reply	other threads:[~2020-06-22 18:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 17:57 [OE-core][dunfell 00/33] Patch review Steve Sakoman
2020-06-22 17:57 ` [OE-core][dunfell 01/33] patchelf: switch to git Steve Sakoman
2020-06-22 17:57 ` [OE-core][dunfell 02/33] powertop: switch to Arjan's git Steve Sakoman
2020-06-22 17:57 ` [OE-core][dunfell 03/33] populate_sdk_base.bbclass: fix warning: name not matched Steve Sakoman
2020-06-22 17:57 ` [OE-core][dunfell 04/33] ltp: Add missing dependencies on coreutils, bc, e2fsprogs and gdb Steve Sakoman
2020-06-22 17:57 ` [OE-core][dunfell 05/33] mdadm: remove service template from SYSTEMD_SERVICE Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 06/33] wpa-supplicant: remove service templates " Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 07/33] encodings: clear postinst script Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 08/33] vim: restore the 'chmod -x' workaround in do_install Steve Sakoman
2020-06-22 17:58 ` Steve Sakoman [this message]
2020-06-22 17:58 ` [OE-core][dunfell 10/33] recipetool: Fix list concatenation when using edit Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 11/33] buildtools-tarball: export OPENSSL_CONF in environment setup Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 12/33] systemd: Sync systemd-serialgetty@.service with upstream Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 13/33] mtd-utils: Fix return value of ubiformat Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 14/33] relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 15/33] install-buildtools: fail if an error occurs Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 16/33] install-buildtools: remove hardcoded x86-64 architecture Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 17/33] libpam: Remove option 'obscure' from common-password Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 18/33] bind: update to 9.11.19 Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 19/33] perl: Fix host specific modules problems Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 20/33] buildhistory-collect-srcrevs: sort directories Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 21/33] common-licenses: add BSD-2-Clause-Patent Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 22/33] oeqa/runtime: Add OERequirePackage decorator Steve Sakoman
2020-06-23 14:32   ` Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 23/33] classes/archiver: Create patched archive before configuring Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 24/33] net-tools: backport a patch from upstream to use the same ifconfig format as debian/ubuntu Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 25/33] go-mod.bbclass: Add class for `go mod` support Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 26/33] glide: Avoid use of 'go mod' support Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 27/33] go-dep: " Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 28/33] go.bbclass: Add `-trimpath` to default build flags Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 29/33] linux-firmware: add ice for Intel E800 series driver Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 30/33] apr-util: make gdbm optional Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 31/33] recipetool: create: fix SRCBRANCH not being passed to params Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 32/33] meson.bbclass: avoid unexpected operating-system names Steve Sakoman
2020-06-22 17:58 ` [OE-core][dunfell 33/33] gstreamer1.0-plugins-bad: add support for vdpau Steve Sakoman

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=0e4985236dd7d2e92576fb30b70bc434a7ecd367.1592848337.git.steve@sakoman.com \
    --to=steve@sakoman.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox