Received: from eggs.gnu.org ([2001:4830:134:3::10]:49622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDr46-0007ZK-DV for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:04:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDr45-0001Dq-CZ for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:04:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cDr45-0001Da-6t for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:04:09 -0500 From: Gerd Hoffmann Date: Mon, 5 Dec 2016 12:03:58 +0100 Message-Id: <1480935840-3961-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1480935840-3961-1-git-send-email-kraxel@redhat.com> References: <1480935840-3961-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 2/4] virtio-gpu: fix information leak in getting capset info dispatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Li Qiang , Gerd Hoffmann , "Michael S. Tsirkin" From: Li Qiang In virgl_cmd_get_capset_info dispatch function, the 'resp' hasn't been full initialized before writing to the guest. This will leak the 'resp.padding' and 'resp.hdr.padding' fieds to the guest. This patch fix this issue. Signed-off-by: Li Qiang Message-id: 5818661e.0860240a.77264.7a56@mx.google.com Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu-3d.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index 758d33a..23f39de 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -347,6 +347,7 @@ static void virgl_cmd_get_capset_info(VirtIOGPU *g, =20 VIRTIO_GPU_FILL_CMD(info); =20 + memset(&resp, 0, sizeof(resp)); if (info.capset_index =3D=3D 0) { resp.capset_id =3D VIRTIO_GPU_CAPSET_VIRGL; virgl_renderer_get_cap_set(resp.capset_id, --=20 1.8.3.1