From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkmku-00036e-4o for qemu-devel@nongnu.org; Fri, 16 Sep 2016 02:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkmkp-0000An-4a for qemu-devel@nongnu.org; Fri, 16 Sep 2016 02:36:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkmko-0000AJ-U9 for qemu-devel@nongnu.org; Fri, 16 Sep 2016 02:36:07 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEC679E60E for ; Fri, 16 Sep 2016 06:36:05 +0000 (UTC) References: <1473178269-16718-1-git-send-email-maxime.coquelin@redhat.com> <1473178269-16718-5-git-send-email-maxime.coquelin@redhat.com> <2e349a9d-8609-b3d6-6681-537c4362c367@redhat.com> From: Maxime Coquelin Message-ID: <61ad2850-d5fa-f2c1-99af-00e1b78d0a15@redhat.com> Date: Fri, 16 Sep 2016 08:36:02 +0200 MIME-Version: 1.0 In-Reply-To: <2e349a9d-8609-b3d6-6681-537c4362c367@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 4/4] virtio-net: Add MTU feature support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , mst@redhat.com, qemu-devel@nongnu.org Cc: jasowang@redhat.com, Aaron Conole 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);