From patchwork Wed Jun 14 03:39:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9785209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBB4F602DC for ; Wed, 14 Jun 2017 03:40:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5FF326E76 for ; Wed, 14 Jun 2017 03:40:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAB20274D0; Wed, 14 Jun 2017 03:40:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4387426E76 for ; Wed, 14 Jun 2017 03:40:13 +0000 (UTC) Received: from localhost ([::1]:46210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKzAC-0007mi-HK for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Jun 2017 23:40:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKz9W-0007mO-9C for qemu-devel@nongnu.org; Tue, 13 Jun 2017 23:39:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKz9T-0002xE-7W for qemu-devel@nongnu.org; Tue, 13 Jun 2017 23:39:30 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:34419) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKz9T-0002u6-0V for qemu-devel@nongnu.org; Tue, 13 Jun 2017 23:39:27 -0400 Received: by mail-pf0-x243.google.com with SMTP id d5so12419725pfe.1 for ; Tue, 13 Jun 2017 20:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=oxPVN1+aJw6/Ccw2rzRb084rNfPuPsVmTmfCKGfuHPU=; b=LguRsxMIeMZr00OfDzYRUdJXDuwZ3JtggUi19SHJRqMkjdHjbvFqT6nAxR5/sRcBsw 5iGAb9kM6EC0+LWwQCJkfy63IVlbsIHvmy8/Ws/VSQ/gnGYwAb9Me5j+kpp7sDEkYR3m P+tJ9NleHhYeYNwPVKY20iUk1UwPzfPZHbEvy2muHR5gri2pdG66puvwbmpIAuSFCmki cykCLv06kTwRP2Lu2roBn/D1FbYOr0WPph+q0Si0bA/y/ktj9okGG1JN4FmMk+3hR7+p KZ1K/WHIXlaZFTwxdndeXV+v7hNJi5dkN2vxvzyaBQ9jcVJNM6bP4xlczvLEPsYSY95x KkZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oxPVN1+aJw6/Ccw2rzRb084rNfPuPsVmTmfCKGfuHPU=; b=F8ZRaXYcGSl9iVZ/Pv+hnY0eFufk0YTu14npcY8TZBeeoEWYqgKKcoiUBTOJsBUNhF Ryo/9Ys+1n+H64ooN07cbHyO3xLGKaAMmkf4KDqVaA9w91OpwjcnxTdmrwyEo9K3QA3D BYnzn23UdceWa1hikao4+5UVR1LyAElBZGpL8N4yqOnQoU1HwHll3Q0XRwEmDo8efXY1 MGRE42eIeB328sfGczJsJLzb4SiQbGlbIEkyL0RTHO/y5bCx3AQe7FB4suyy/b4PQakl sVGgX3eXMR03Z0LPEPP/9ID8/RElvoZWvrCo5r4TDXnnImg9a6HdNoFLAouNW11iAZU0 pzfg== X-Gm-Message-State: AKS2vOwbXbqWO53GhaExs8D7HgZtCGtzqTVYMed3PVsRR9lFm5scJJ/H QWGHc2qMec921550 X-Received: by 10.99.174.5 with SMTP id q5mr2354552pgf.196.1497411564392; Tue, 13 Jun 2017 20:39:24 -0700 (PDT) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id o24sm37444799pgc.11.2017.06.13.20.39.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 20:39:23 -0700 (PDT) From: Li Qiang X-Google-Original-From: Li Qiang To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Tue, 13 Jun 2017 20:39:04 -0700 Message-Id: <1497411544-80213-1-git-send-email-liqiang6-s@360.cn> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , liqiang6-s@360.cn, ppandit@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Li Qiang In 'xhci_write_event' function, the 'ev_trb' is not full initialized. This will lead an info leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/usb/hcd-xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index a0c7960..537997e 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -646,6 +646,7 @@ static void xhci_write_event(XHCIState *xhci, XHCIEvent *event, int v) XHCITRB ev_trb; dma_addr_t addr; + memset(&ev_trb, 0, sizeof(ev_trb)); ev_trb.parameter = cpu_to_le64(event->ptr); ev_trb.status = cpu_to_le32(event->length | (event->ccode << 24)); ev_trb.control = (event->slotid << 24) | (event->epid << 16) |