qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix an infinite loop in the emulated SB16 device
Date: Mon, 28 Jan 2008 20:30:09 +0100	[thread overview]
Message-ID: <20080128193009.GA19255@volta.aurel32.net> (raw)

This patch from Tavis Ormandy <taviso@google.com> fixes an infinite
loop in the emulated SB16 device.

See http://taviso.decsystem.org/virtsec.pdf for more details.
---
 hw/sb16.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/sb16.c b/hw/sb16.c
index c22de7a..b2a3a70 100644
--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -1246,8 +1246,10 @@ static int SB_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len)
             s->block_size);
 #endif
 
-    while (s->left_till_irq <= 0) {
-        s->left_till_irq = s->block_size + s->left_till_irq;
+    if (s->block_size) {
+        while (s->left_till_irq <= 0) {
+            s->left_till_irq = s->block_size + s->left_till_irq;
+        }
     }
 
     return dma_pos;

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

             reply	other threads:[~2008-01-28 19:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 19:30 Aurelien Jarno [this message]
2008-01-29 16:54 ` [Qemu-devel] [PATCH] Fix an infinite loop in the emulated SB16 device malc

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=20080128193009.GA19255@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).