All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Volker Rümelin" <vr_qemu@t-online.de>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PULL 1/4] ossaudio: fix out of bounds write
Date: Mon, 13 Jul 2020 16:10:46 +0200	[thread overview]
Message-ID: <20200713141049.2241-2-kraxel@redhat.com> (raw)
In-Reply-To: <20200713141049.2241-1-kraxel@redhat.com>

From: Volker Rümelin <vr_qemu@t-online.de>

In function oss_read() a read error currently does not exit the
read loop. With no data to read the variable pos will quickly
underflow and a subsequent successful read overwrites memory
outside the buffer. This patch adds the missing break statement
to the error path of the function.

To reproduce start qemu with -audiodev oss,id=audio0 and in the
guest start audio recording. After some time this will trigger
an exception.

Fixes: 3ba4066d08 "ossaudio: port to the new audio backend api"

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200707180836.5435-1-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/ossaudio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index f88d076ec236..a7dcaa31adeb 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -691,6 +691,7 @@ static size_t oss_read(HWVoiceIn *hw, void *buf, size_t len)
                            len, dst);
                 break;
             }
+            break;
         }
 
         pos += nread;
-- 
2.18.4



  reply	other threads:[~2020-07-13 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 14:10 [PULL 0/4] Fixes 20200713 patches Gerd Hoffmann
2020-07-13 14:10 ` Gerd Hoffmann [this message]
2020-07-13 14:10 ` [PULL 2/4] docs/qdev-device-use: Clean up the sentences related to -usbdevice Gerd Hoffmann
2020-07-13 14:14   ` Peter Maydell
2020-07-13 14:10 ` [PULL 3/4] ui: fix vc_chr_write call in text_console_do_init Gerd Hoffmann
2020-07-13 14:10 ` [PULL 4/4] usb: fix usb-host build on windows Gerd Hoffmann
2020-07-13 17:58 ` [PULL 0/4] Fixes 20200713 patches Peter Maydell

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=20200713141049.2241-2-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vr_qemu@t-online.de \
    /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.