From nobody Thu Nov 6 06:47:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149741163265941.62797873347324; Tue, 13 Jun 2017 20:40:32 -0700 (PDT) Received: from localhost ([::1]:46218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKzAU-000881-NN for importer@patchew.org; Tue, 13 Jun 2017 23:40:30 -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) 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) 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) 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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; =20 + memset(&ev_trb, 0, sizeof(ev_trb)); ev_trb.parameter =3D cpu_to_le64(event->ptr); ev_trb.status =3D cpu_to_le32(event->length | (event->ccode << 24)); ev_trb.control =3D (event->slotid << 24) | (event->epid << 16) | --=20 2.7.4