From: P J P <ppandit@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Li Qiang <liqiang6-s@360.cn>,
Qemu Developers <qemu-devel@nongnu.org>,
Leon Alrae <leon.alrae@imgtec.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v2] net: mipsnet: check transmit buffer size before sending
Date: Mon, 13 Jun 2016 12:47:55 +0530 (IST) [thread overview]
Message-ID: <alpine.LFD.2.20.1606131243140.16918@wniryva> (raw)
In-Reply-To: <575E2226.5010004@redhat.com>
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.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
next prev parent reply other threads:[~2016-06-13 7:18 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 [this message]
2016-06-15 8:48 ` Jason Wang
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=alpine.LFD.2.20.1606131243140.16918@wniryva \
--to=ppandit@redhat.com \
--cc=aurelien@aurel32.net \
--cc=jasowang@redhat.com \
--cc=leon.alrae@imgtec.com \
--cc=liqiang6-s@360.cn \
--cc=peter.maydell@linaro.org \
--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).