From nobody Sun Apr 28 18:17:15 2024 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.zohomail.com; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507194560365782.349642914741; Thu, 5 Oct 2017 02:09:20 -0700 (PDT) Received: from localhost ([::1]:38530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e029a-0001du-Lw for importer@patchew.org; Thu, 05 Oct 2017 05:09:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e025P-0007Kv-23 for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e025J-00048V-21 for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52666) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e025I-00047d-PT for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D63E072FFB for ; Thu, 5 Oct 2017 09:04:47 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E2165FCCB; Thu, 5 Oct 2017 09:04:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1C5ED4057A; Thu, 5 Oct 2017 11:04:43 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D63E072FFB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 5 Oct 2017 11:04:40 +0200 Message-Id: <20171005090443.26889-2-kraxel@redhat.com> In-Reply-To: <20171005090443.26889-1-kraxel@redhat.com> References: <20171005090443.26889-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 05 Oct 2017 09:04:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/4] hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple() 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: Thomas Huth , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Valgrind detects an invalid read operation when hot-plugging of an USB device fails: $ valgrind x86_64-softmmu/qemu-system-x86_64 -device usb-ehci -nographic -S =3D=3D30598=3D=3D Memcheck, a memory error detector =3D=3D30598=3D=3D Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward = et al. =3D=3D30598=3D=3D Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyr= ight info =3D=3D30598=3D=3D Command: x86_64-softmmu/qemu-system-x86_64 -device usb-eh= ci -nographic -S =3D=3D30598=3D=3D QEMU 2.10.50 monitor - type 'help' for more information (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet =3D=3D30598=3D=3D Invalid read of size 8 =3D=3D30598=3D=3D at 0x60EF50: object_unparent (object.c:445) =3D=3D30598=3D=3D by 0x580F0D: usb_try_create_simple (bus.c:346) =3D=3D30598=3D=3D by 0x581BEB: usb_claim_port (bus.c:451) =3D=3D30598=3D=3D by 0x582310: usb_qdev_realize (bus.c:257) =3D=3D30598=3D=3D by 0x4CB399: device_set_realized (qdev.c:914) =3D=3D30598=3D=3D by 0x60E26D: property_set_bool (object.c:1886) =3D=3D30598=3D=3D by 0x61235E: object_property_set_qobject (qom-qobject.= c:27) =3D=3D30598=3D=3D by 0x61000F: object_property_set_bool (object.c:1162) =3D=3D30598=3D=3D by 0x4567C3: qdev_device_add (qdev-monitor.c:630) =3D=3D30598=3D=3D by 0x456D52: qmp_device_add (qdev-monitor.c:807) =3D=3D30598=3D=3D by 0x470A99: hmp_device_add (hmp.c:1933) =3D=3D30598=3D=3D by 0x3679C3: handle_hmp_command (monitor.c:3123) The object_unparent() here is not necessary anymore since commit 69382d8b3e8600b3 ("qdev: Fix object reference leak in case device.realize() fails"), so let's remove it now. Suggested-by: Paolo Bonzini Signed-off-by: Thomas Huth Message-id: 1506526106-30971-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index d910f849e7..e56dc3348a 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -341,9 +341,7 @@ static USBDevice *usb_try_create_simple(USBBus *bus, co= nst char *name, object_property_set_bool(OBJECT(dev), true, "realized", &err); if (err) { error_propagate(errp, err); - error_prepend(errp, "Failed to initialize USB device '%s': ", - name); - object_unparent(OBJECT(dev)); + error_prepend(errp, "Failed to initialize USB device '%s': ", name= ); return NULL; } return dev; --=20 2.9.3 From nobody Sun Apr 28 18:17:15 2024 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.zohomail.com; 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 1507194584113254.2829424354868; Thu, 5 Oct 2017 02:09:44 -0700 (PDT) Received: from localhost ([::1]:38531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e029x-0001tl-9f for importer@patchew.org; Thu, 05 Oct 2017 05:09:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e025S-0007Nz-Pp for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e025J-00048b-4M for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60998) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e025I-00047M-Ux for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 86CCB7E427; Thu, 5 Oct 2017 09:04:47 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id B991D600C0; Thu, 5 Oct 2017 09:04:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2369A4057E; Thu, 5 Oct 2017 11:04:43 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 86CCB7E427 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 5 Oct 2017 11:04:41 +0200 Message-Id: <20171005090443.26889-3-kraxel@redhat.com> In-Reply-To: <20171005090443.26889-1-kraxel@redhat.com> References: <20171005090443.26889-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 05 Oct 2017 09:04:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/4] usb: fix libusb config variable name. 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: Jan Kiszka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Jan Kiszka Fixes: 4e5ee5b21c84fe3023a64b5cc2e12a52ab0597c1 Signed-off-by: Gerd Hoffmann Tested-by: Jan Kiszka Message-id: 20170926063820.30773-1-kraxel@redhat.com --- hw/usb/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 9255234c63..0e6d54b21f 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -42,7 +42,7 @@ redirect.o-cflags =3D $(USB_REDIR_CFLAGS) redirect.o-libs =3D $(USB_REDIR_LIBS) =20 # usb pass-through -ifeq ($(CONFIG_LIBUSB)$(CONFIG_USB),yy) +ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy) common-obj-y +=3D host-libusb.o host-legacy.o else common-obj-y +=3D host-stub.o --=20 2.9.3 From nobody Sun Apr 28 18:17:15 2024 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.zohomail.com; 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 1507194463166987.7504121992242; Thu, 5 Oct 2017 02:07:43 -0700 (PDT) Received: from localhost ([::1]:38523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0282-0000UB-3p for importer@patchew.org; Thu, 05 Oct 2017 05:07:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e025N-0007K9-Hu for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e025L-0004A7-2P for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e025K-00049R-SF for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F098C883C3 for ; Thu, 5 Oct 2017 09:04:49 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB1B017981; Thu, 5 Oct 2017 09:04:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2A5623F116; Thu, 5 Oct 2017 11:04:43 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F098C883C3 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 5 Oct 2017 11:04:42 +0200 Message-Id: <20171005090443.26889-4-kraxel@redhat.com> In-Reply-To: <20171005090443.26889-1-kraxel@redhat.com> References: <20171005090443.26889-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 05 Oct 2017 09:04:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/4] usb: Use angle brackets for cacard include directive 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: Fam Zheng , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng This is a library header, so angle brackets are more appropriate; also move the line to before QEMU headers, as is recommended in HACKING. Signed-off-by: Fam Zheng Message-id: 20170920085952.3872-1-famz@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/ccid-card-passthru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 45d96b03c6..117711862e 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -9,11 +9,11 @@ */ =20 #include "qemu/osdep.h" +#include #include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/sockets.h" #include "ccid.h" -#include "cacard/vscard_common.h" =20 #define DPRINTF(card, lvl, fmt, ...) \ do { \ --=20 2.9.3 From nobody Sun Apr 28 18:17:15 2024 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.zohomail.com; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507194486553576.3808385880999; Thu, 5 Oct 2017 02:08:06 -0700 (PDT) Received: from localhost ([::1]:38526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e028O-0000kc-MR for importer@patchew.org; Thu, 05 Oct 2017 05:08:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e025N-0007KC-IR for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e025I-00047z-Kt for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e025I-00046t-FK for qemu-devel@nongnu.org; Thu, 05 Oct 2017 05:04:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFF394E34A for ; Thu, 5 Oct 2017 09:04:46 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-239.ams2.redhat.com [10.36.116.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCC3D600C8; Thu, 5 Oct 2017 09:04:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 314634057F; Thu, 5 Oct 2017 11:04:43 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DFF394E34A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 5 Oct 2017 11:04:43 +0200 Message-Id: <20171005090443.26889-5-kraxel@redhat.com> In-Reply-To: <20171005090443.26889-1-kraxel@redhat.com> References: <20171005090443.26889-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 05 Oct 2017 09:04:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] usb: fix host-stub.c build race 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Suggested-by: Thomas Huth Signed-off-by: Gerd Hoffmann Reviewed-by: Thomas Huth Message-id: 20171004125210.7817-1-kraxel@redhat.com --- hw/usb/Makefile.objs | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 0e6d54b21f..bdfead6701 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -47,6 +47,7 @@ common-obj-y +=3D host-libusb.o host-legacy.o else common-obj-y +=3D host-stub.o endif +common-obj-$(CONFIG_ALL) +=3D host-stub.o =20 host-libusb.o-cflags :=3D $(LIBUSB_CFLAGS) host-libusb.o-libs :=3D $(LIBUSB_LIBS) --=20 2.9.3