From nobody Sat Apr 27 18:17:19 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528980417631358.63258157266546; Thu, 14 Jun 2018 05:46:57 -0700 (PDT) Received: from localhost ([::1]:40337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTReS-0003JI-VO for importer@patchew.org; Thu, 14 Jun 2018 08:46:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTRbF-0001F6-5M for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTRbB-0005K7-5k for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41786 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTRbB-0005Jh-1d for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47238401EF06 for ; Thu, 14 Jun 2018 12:43:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F0162022EF2; Thu, 14 Jun 2018 12:43:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CAE291138647; Thu, 14 Jun 2018 14:43:30 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 14:43:28 +0200 Message-Id: <20180614124330.12224-2-armbru@redhat.com> In-Reply-To: <20180614124330.12224-1-armbru@redhat.com> References: <20180614124330.12224-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL v2 1/3] Revert "Makefile: add target to print generated files" 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: "Michael S . Tsirkin" 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" This reverts commit 9578f8cc3e8bd71de8e3f543dc7b95644d64824e. The patch snuck in by accident without having been posted to qemu-devel. It's entirely redundant: existing target print-% already serves the purpose. Cc: Michael S. Tsirkin Signed-off-by: Markus Armbruster Message-Id: <20180504054241.6833-1-armbru@redhat.com> Reviewed-by: Eric Blake --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 6c6664d9a3..355b44ff37 100644 --- a/Makefile +++ b/Makefile @@ -1055,9 +1055,6 @@ endif include $(SRC_PATH)/tests/docker/Makefile.include include $(SRC_PATH)/tests/vm/Makefile.include =20 -printgen: - @echo $(GENERATED_FILES) - .PHONY: help help: @echo 'Generic targets:' --=20 2.17.1 From nobody Sat Apr 27 18:17:19 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528980303814104.51376177585905; Thu, 14 Jun 2018 05:45:03 -0700 (PDT) Received: from localhost ([::1]:40325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTRcU-0001u3-Po for importer@patchew.org; Thu, 14 Jun 2018 08:44:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTRbF-0001F7-5e for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTRbB-0005K3-5L for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37966 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTRbB-0005Jg-0s for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4457C80125D6 for ; Thu, 14 Jun 2018 12:43:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F07D111AF1C; Thu, 14 Jun 2018 12:43:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CE8CC113864D; Thu, 14 Jun 2018 14:43:30 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 14:43:29 +0200 Message-Id: <20180614124330.12224-3-armbru@redhat.com> In-Reply-To: <20180614124330.12224-1-armbru@redhat.com> References: <20180614124330.12224-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL v2 2/3] coverity-model: replay data is considered trusted 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: Paolo Bonzini 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: Paolo Bonzini Replay data is not considered a possible attack vector; add a model that does not use getc so that "tainted data" warnings are suppressed. Signed-off-by: Paolo Bonzini Message-Id: <20180514141218.28438-1-pbonzini@redhat.com> Reviewed-by: Markus Armbruster [Whitespace tweaked] Signed-off-by: Markus Armbruster --- scripts/coverity-model.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c index c702804f41..2ec753db05 100644 --- a/scripts/coverity-model.c +++ b/scripts/coverity-model.c @@ -103,6 +103,18 @@ static int get_keysym(const name2keysym_t *table, } } =20 +/* Replay data is considered trusted. */ +uint8_t replay_get_byte(void) +{ + uint8_t byte =3D 0; + if (replay_file) { + uint8_t c; + byte =3D c; + } + return byte; +} + + /* * GLib memory allocation functions. * --=20 2.17.1 From nobody Sat Apr 27 18:17:19 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528980417532647.9240829278776; Thu, 14 Jun 2018 05:46:57 -0700 (PDT) Received: from localhost ([::1]:40338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTReS-0003JP-Qb for importer@patchew.org; Thu, 14 Jun 2018 08:46:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTRbF-0001F8-6L for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTRbB-0005Jz-5Z for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58490 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTRbB-0005Jj-0C for qemu-devel@nongnu.org; Thu, 14 Jun 2018 08:43:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F9B8400ADC5 for ; Thu, 14 Jun 2018 12:43:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-1.ams2.redhat.com [10.36.117.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F2A2111AF25 for ; Thu, 14 Jun 2018 12:43:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D1EF71138650; Thu, 14 Jun 2018 14:43:30 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 14:43:30 +0200 Message-Id: <20180614124330.12224-4-armbru@redhat.com> In-Reply-To: <20180614124330.12224-1-armbru@redhat.com> References: <20180614124330.12224-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 14 Jun 2018 12:43:32 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL v2 3/3] Purge uses of banned g_assert_FOO() 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We banned use of certain g_assert_FOO() functions outside tests, and made checkpatch.pl flag them (commit 6e9389563e5). We neglected to purge existing uses. Do that now. Signed-off-by: Markus Armbruster Message-Id: <20180608170231.27912-1-armbru@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: John Snow --- hw/ide/ahci.c | 2 +- hw/ppc/spapr_ovec.c | 12 ++++++------ hw/usb/dev-smartcard-reader.c | 2 +- qom/object.c | 10 +++++----- util/qht.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index f7852be842..2ec24cad9f 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -440,7 +440,7 @@ static uint64_t ahci_mem_read(void *opaque, hwaddr addr= , unsigned size) if (ofst + size <=3D 4) { val =3D lo >> (ofst * 8); } else { - g_assert_cmpint(size, >, 1); + g_assert(size > 1); =20 /* If the 64bit read is unaligned, we will produce undefined * results. AHCI does not support unaligned 64bit reads. */ diff --git a/hw/ppc/spapr_ovec.c b/hw/ppc/spapr_ovec.c index 41df4c35ba..318bf33de4 100644 --- a/hw/ppc/spapr_ovec.c +++ b/hw/ppc/spapr_ovec.c @@ -113,7 +113,7 @@ void spapr_ovec_cleanup(sPAPROptionVector *ov) void spapr_ovec_set(sPAPROptionVector *ov, long bitnr) { g_assert(ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); + g_assert(bitnr < OV_MAXBITS); =20 set_bit(bitnr, ov->bitmap); } @@ -121,7 +121,7 @@ void spapr_ovec_set(sPAPROptionVector *ov, long bitnr) void spapr_ovec_clear(sPAPROptionVector *ov, long bitnr) { g_assert(ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); + g_assert(bitnr < OV_MAXBITS); =20 clear_bit(bitnr, ov->bitmap); } @@ -129,7 +129,7 @@ void spapr_ovec_clear(sPAPROptionVector *ov, long bitnr) bool spapr_ovec_test(sPAPROptionVector *ov, long bitnr) { g_assert(ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); + g_assert(bitnr < OV_MAXBITS); =20 return test_bit(bitnr, ov->bitmap) ? true : false; } @@ -186,7 +186,7 @@ sPAPROptionVector *spapr_ovec_parse_vector(target_ulong= table_addr, int vector) int i; =20 g_assert(table_addr); - g_assert_cmpint(vector, >=3D, 1); /* vector numbering starts at 1 */ + g_assert(vector >=3D 1); /* vector numbering starts at 1 */ =20 addr =3D vector_addr(table_addr, vector); if (!addr) { @@ -195,7 +195,7 @@ sPAPROptionVector *spapr_ovec_parse_vector(target_ulong= table_addr, int vector) } =20 vector_len =3D ldub_phys(&address_space_memory, addr++) + 1; - g_assert_cmpint(vector_len, <=3D, OV_MAXBYTES); + g_assert(vector_len <=3D OV_MAXBYTES); ov =3D spapr_ovec_new(); =20 for (i =3D 0; i < vector_len; i++) { @@ -225,7 +225,7 @@ int spapr_ovec_populate_dt(void *fdt, int fdt_offset, * encoding/sizing expected in ibm,client-architecture-support */ vec_len =3D (lastbit =3D=3D OV_MAXBITS) ? 1 : lastbit / BITS_PER_BYTE = + 1; - g_assert_cmpint(vec_len, <=3D, OV_MAXBYTES); + g_assert(vec_len <=3D OV_MAXBYTES); /* guest expects vector len encoded as vec_len - 1, since the length b= yte * is assumed and not included, and the first byte of the vector * is assumed as well diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index f7c91230d5..fa546fb3ce 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -786,7 +786,7 @@ static void ccid_write_data_block(USBCCIDState *s, uint= 8_t slot, uint8_t seq, DPRINTF(s, D_VERBOSE, "error %d\n", p->b.bError); } if (len) { - g_assert_nonnull(data); + assert(data); memcpy(p->abData, data, len); } ccid_reset_error_status(s); diff --git a/qom/object.c b/qom/object.c index e6462f289c..4609e34a6a 100644 --- a/qom/object.c +++ b/qom/object.c @@ -295,7 +295,7 @@ static void type_initialize(TypeImpl *ti) GSList *e; int i; =20 - g_assert_cmpint(parent->class_size, <=3D, ti->class_size); + g_assert(parent->class_size <=3D ti->class_size); memcpy(ti->class, parent->class, parent->class_size); ti->class->interfaces =3D NULL; ti->class->properties =3D g_hash_table_new_full( @@ -372,9 +372,9 @@ static void object_initialize_with_type(void *data, siz= e_t size, TypeImpl *type) g_assert(type !=3D NULL); type_initialize(type); =20 - g_assert_cmpint(type->instance_size, >=3D, sizeof(Object)); + g_assert(type->instance_size >=3D sizeof(Object)); g_assert(type->abstract =3D=3D false); - g_assert_cmpint(size, >=3D, type->instance_size); + g_assert(size >=3D type->instance_size); =20 memset(obj, 0, type->instance_size); obj->class =3D type->class; @@ -475,7 +475,7 @@ static void object_finalize(void *data) object_property_del_all(obj); object_deinit(obj, ti); =20 - g_assert_cmpint(obj->ref, =3D=3D, 0); + g_assert(obj->ref =3D=3D 0); if (obj->free) { obj->free(obj); } @@ -917,7 +917,7 @@ void object_unref(Object *obj) if (!obj) { return; } - g_assert_cmpint(obj->ref, >, 0); + g_assert(obj->ref > 0); =20 /* parent always holds a reference to its children */ if (atomic_fetch_dec(&obj->ref) =3D=3D 1) { diff --git a/util/qht.c b/util/qht.c index ff4d2e6974..55b0738cd1 100644 --- a/util/qht.c +++ b/util/qht.c @@ -759,7 +759,7 @@ static void qht_do_resize_reset(struct qht *ht, struct = qht_map *new, bool reset) return; } =20 - g_assert_cmpuint(new->n_buckets, !=3D, old->n_buckets); + g_assert(new->n_buckets !=3D old->n_buckets); qht_map_iter__all_locked(ht, old, qht_map_copy, new); qht_map_debug__all_locked(new); =20 --=20 2.17.1