[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] net: mipsnet: check transmit buffer size bef

From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH v2] net: mipsnet: check transmit buffer size before sending
Date: Wed, 15 Jun 2016 16:48:04 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

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

Thank you.

Ok, applied.

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


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]