From: Jason Wang <jasowang@redhat.com>
To: P J P <ppandit@redhat.com>, Qemu Developers <qemu-devel@nongnu.org>
Cc: Oleksandr Bazhaniuk <oleksandr.bazhaniuk@intel.com>,
Prasad J Pandit <pjp@fedoraproject.org>
Subject: Re: [Qemu-devel] [PATCH] net: mipsnet: check packet length against buffer
Date: Tue, 26 Apr 2016 15:16:55 +0800 [thread overview]
Message-ID: <571F15E7.2080808@redhat.com> (raw)
In-Reply-To: <1460024762-14592-1-git-send-email-ppandit@redhat.com>
On 04/07/2016 06:26 PM, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
>
> When receiving packets over MIPSnet network device, it uses
> receive buffer of size 1514 bytes. In case the controller
> accepts large(MTU) packets, it could lead to memory corruption.
> Add check to avoid it.
>
> Reported by: Oleksandr Bazhaniuk <oleksandr.bazhaniuk@intel.com>
>
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
> hw/net/mipsnet.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c
> index f261011..e134b31 100644
> --- a/hw/net/mipsnet.c
> +++ b/hw/net/mipsnet.c
> @@ -82,6 +82,9 @@ static ssize_t mipsnet_receive(NetClientState *nc, const uint8_t *buf, size_t si
> if (!mipsnet_can_receive(nc))
> return 0;
>
> + if (size >= sizeof(s->rx_buffer)) {
> + return 0;
> + }
> s->busy = 1;
>
> /* Just accept everything. */
Apply to net-next.
Thanks
prev parent reply other threads:[~2016-04-26 7:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 10:26 [Qemu-devel] [PATCH] net: mipsnet: check packet length against buffer P J P
2016-04-07 15:44 ` Markus Armbruster
2016-04-11 7:37 ` P J P
2016-04-11 8:27 ` Jason Wang
2016-04-11 8:51 ` P J P
2016-04-26 7:16 ` Jason Wang [this message]
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=571F15E7.2080808@redhat.com \
--to=jasowang@redhat.com \
--cc=oleksandr.bazhaniuk@intel.com \
--cc=pjp@fedoraproject.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).