qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: akong@redhat.com
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH] virtio-net: introduce a new macaddr control
Date: Fri, 11 Jan 2013 10:50:17 +0100	[thread overview]
Message-ID: <20130111095017.GD14394@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1357829517-25656-1-git-send-email-akong@redhat.com>

On Thu, Jan 10, 2013 at 10:51:57PM +0800, akong@redhat.com wrote:
> @@ -349,6 +351,13 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
>  {
>      struct virtio_net_ctrl_mac mac_data;
>  
> +    if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET && elem->out_num == 2) {
> +        /* Set MAC address */
> +        memcpy(n->mac, elem->out_sg[1].iov_base, elem->out_sg[1].iov_len);

We cannot trust the guest's iov_len, it could overflow n->mac.

  reply	other threads:[~2013-01-11  9:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 14:45 [Qemu-devel] [RFC PATCH 0/2] make mac programming for virtio net more robust akong
2013-01-10 14:45 ` [Qemu-devel] [RFC PATCH 1/2] move virtnet_send_command() above virtnet_set_mac_address() akong
2013-01-10 14:51   ` Jason Wang
2013-01-10 15:02     ` Michael S. Tsirkin
2013-01-10 14:45 ` [Qemu-devel] [RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr akong
2013-01-10 14:57   ` Jason Wang
2013-01-16  5:23     ` Amos Kong
2013-01-16  9:17       ` Michael S. Tsirkin
2013-01-10 15:26   ` Michael S. Tsirkin
2013-01-11  0:43     ` Rusty Russell
2013-01-10 14:51 ` [Qemu-devel] [RFC PATCH] virtio-net: introduce a new macaddr control akong
2013-01-11  9:50   ` Stefan Hajnoczi [this message]
2013-01-10 15:08 ` [Qemu-devel] [RFC PATCH 0/2] make mac programming for virtio net more robust Amos Kong
2013-01-10 15:28 ` Michael S. Tsirkin
2013-01-11  2:23   ` Rusty Russell
2013-01-11  7:46     ` Michael S. Tsirkin
2013-01-11 14:52       ` John Fastabend

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=20130111095017.GD14394@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@gmail.com \
    --cc=akong@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.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).