qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Leon Alrae <leon.alrae@imgtec.com>, Li Qiang <liqiang6-s@360.cn>,
	Qemu Developers <qemu-devel@nongnu.org>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v2] net: mipsnet: check transmit buffer size before sending
Date: Wed, 15 Jun 2016 16:48:04 +0800	[thread overview]
Message-ID: <57611644.40607@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1606131243140.16918@wniryva>



On 2016年06月13日 15:17, P J P wrote:
>    Hello Jason,
>
> +-- On Mon, 13 Jun 2016, Jason Wang wrote --+
> | >       case MIPSNET_TX_DATA_BUFFER:
> | >           s->tx_buffer[s->tx_written++] = val;
> |
> | I believe we may still have a buffer overflow here, no?
>
>    No, this is the overflow that the patch is meant to fix.
>   
> | > -        if (s->tx_written == s->tx_count) {
> | > +        if ((s->tx_written >= MAX_ETH_FRAME_SIZE)
> | > +            || (s->tx_written == s->tx_count)) {
> | >               /* Send buffer. */
>
>    Earlier, send buffer would occur when if 'tx_written' reached 'tx_count'.
> With this patch, it'll also occur when 'tx_written' reaches maximum frame
> size.
>
> Thank you.

Ok, applied.

I tend to remove mipsnet in the future (maybe 2.8).

Thanks

> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
>

  reply	other threads:[~2016-06-15  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 10:37 [Qemu-devel] [PATCH v2] net: mipsnet: check transmit buffer size before sending P J P
2016-06-13  3:01 ` Jason Wang
2016-06-13  7:17   ` P J P
2016-06-15  8:48     ` Jason Wang [this message]
2016-06-15 17:06       ` 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=57611644.40607@redhat.com \
    --to=jasowang@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --cc=liqiang6-s@360.cn \
    --cc=peter.maydell@linaro.org \
    --cc=ppandit@redhat.com \
    --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).