qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: P J P <ppandit@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: QEMU Developer <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for-2.5] eepro100: Prevent two endless loops
Date: Fri, 20 Nov 2015 14:09:19 +0530 (IST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1511201340040.19670@wniryva> (raw)
In-Reply-To: <1448005353-16007-1-git-send-email-sw@weilnetz.de>

+-- On Fri, 20 Nov 2015, Stefan Weil wrote --+
| diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
| index 60333b7..685a478 100644
| --- a/hw/net/eepro100.c
| +++ b/hw/net/eepro100.c
| @@ -774,6 +774,11 @@ static void tx_command(EEPRO100State *s)
|  #if 0
|          uint16_t tx_buffer_el = lduw_le_pci_dma(&s->dev, tbd_address + 6);
|  #endif
| +        if (tx_buffer_size == 0) {
| +            /* Prevent an endless loop. */
| +            logout("loop in %s:%u\n", __FILE__, __LINE__);
| +            break;
| +        }

   Yes, looks good. Where is 'lduw_le_pci_dma' routine defined?

|  static void action_command(EEPRO100State *s)
|  {
| +    /* The loop below won't stop if it gets special handcrafted data.
| +       Therefore we limit the number of iterations. */
| +    unsigned max_loop_count = 16;
| +

   Is '16' a lower count for the command list? Earilier Jason mentioned 256. 
Not sure what is an ideal count.

Thank you.
--
 - P J P
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

  reply	other threads:[~2015-11-20  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  7:42 [Qemu-devel] [PATCH for-2.5] eepro100: Prevent two endless loops Stefan Weil
2015-11-20  8:39 ` P J P [this message]
2015-11-20  8:52   ` Stefan Weil
2015-11-20 11:27     ` P J P
2015-11-25  3:08       ` Jason Wang

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=alpine.LFD.2.20.1511201340040.19670@wniryva \
    --to=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.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 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).