From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
mst@redhat.com, qemu-devel@nongnu.org
Cc: jasowang@redhat.com, Aaron Conole <aconole@redhat.com>
Subject: Re: [Qemu-devel] [RFC 4/4] virtio-net: Add MTU feature support
Date: Fri, 16 Sep 2016 08:36:02 +0200 [thread overview]
Message-ID: <61ad2850-d5fa-f2c1-99af-00e1b78d0a15@redhat.com> (raw)
In-Reply-To: <2e349a9d-8609-b3d6-6681-537c4362c367@redhat.com>
On 09/16/2016 12:16 AM, Paolo Bonzini wrote:
>
>
> On 06/09/2016 18:11, Maxime Coquelin wrote:
>> VirtIONet *n = VIRTIO_NET(vdev);
>> struct virtio_net_config netcfg;
>>
>> + if (virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MTU)) {
>> + virtio_stw_p(vdev, &netcfg.mtu, n->mtu);
>> + }
>
> This write needs to be unconditional, otherwise you are leaking a few
> bytes of QEMU's stack (corresponding to netcfg.mtu) to the guest.
Right, thanks for pointing this out. I'll make it unconditional.
Maxime
> Paolo
>
>> virtio_stw_p(vdev, &netcfg.status, n->status);
>> virtio_stw_p(vdev, &netcfg.max_virtqueue_pairs, n->max_queues);
>> memcpy(netcfg.mac, n->mac, ETH_ALEN);
prev parent reply other threads:[~2016-09-16 6:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 16:11 [Qemu-devel] [RFC 0/4] virtio-net: Add support to MTU feature Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 1/4] virtio-net: reuse MTU related bits from Linux header Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 2/4] vhost-user: Add new protocol feature MTU Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 3/4] vhost-net: Add new MTU feature support Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 4/4] virtio-net: Add " Maxime Coquelin
2016-09-15 22:16 ` Paolo Bonzini
2016-09-16 6:36 ` Maxime Coquelin [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=61ad2850-d5fa-f2c1-99af-00e1b78d0a15@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=aconole@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@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).