From nobody Sun Nov 24 13:28:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1723568857; cv=none; d=zohomail.com; s=zohoarc; b=A1MB+ccIOqz75v17n3JqtymWWUYxoAmk2L7u7TSWUBcz206QViEKZYEeD6/wzExSgO+I30ktA383t4YUIm3aVR44m/Uwgih/gKma2yhvGSDZpYNv9doKJ28A3D+E0lbdsIxzAwhG5pS40N5DQ+Si0sh5X3A54zwQ3tonpZQSNw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723568857; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=83GI1fDfDMGezYy05oq4L94LxUNct25QLDIJmFGGzPE=; b=DUV/bPd+cR5kv7b2TBxVWMOzmdqcmIBSaplwkj/e7MABqV1PgpcJMThRVv085NtzkNlsoOQ0b0yeykNJg55PYwXRKZzctBcSqLqoNoI9M7YHzeWjC1eGYJqWhnfX0HRbkIlx97QWOq+s7twC9FBSSHvBxZgsbl9i0YxTMjM92z0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723568857211845.0461138503804; Tue, 13 Aug 2024 10:07:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sduyX-0006RY-Db; Tue, 13 Aug 2024 13:06:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sduyV-0006FA-8w for qemu-devel@nongnu.org; Tue, 13 Aug 2024 13:06:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sduyR-00038N-Ih for qemu-devel@nongnu.org; Tue, 13 Aug 2024 13:06:23 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-YDsk1ZeDNxOZ1ays2ZKOEg-1; Tue, 13 Aug 2024 13:06:17 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5bb8fc3df4aso4310808a12.0 for ; Tue, 13 Aug 2024 10:06:17 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bd190ad1bcsm3114523a12.30.2024.08.13.10.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 10:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723568779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=83GI1fDfDMGezYy05oq4L94LxUNct25QLDIJmFGGzPE=; b=E0+/QDUPRXG7s1BRegkDiLooxO91XWq5iI4RMmd30Fj/EnxuPlGk00aq4hoEh+6bzJpv/e dNnvxllqY9/eAGa1q2t3cCqIKab+n2fqShvh1D5ow7dBDQDBDFxZwEyvESYlvLZLh/wBSo 8NEHb7rGXVUTWjwf6udryJriRwPauS0= X-MC-Unique: YDsk1ZeDNxOZ1ays2ZKOEg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723568776; x=1724173576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=83GI1fDfDMGezYy05oq4L94LxUNct25QLDIJmFGGzPE=; b=qUXqImvyEnHCAgugzPX4I5NGvXbtypmnIcSymNkBbABtp5HhETDGUL1yyuMxbebVbn lsjuix2fX4TswoMNe68wCPTsGAICKY7cZ93N2NeFtSDHF1yjYNC/GlaMN7X7ed0Oygd3 4JwG9B1xO4FXWyySL6OWFuj0GM9YZAL1nxzCwv43jCdigU0UmGQMOCauvxDD/Pvlqy/C 37oBcmHUN+I5/dOrYcAQCB8SNoA0rQGIQRhUYdXqo9ktYHnd+NkY0ZFp2f/XQxWx3wKd tpw2UvY1Xtu+Y3IC3JvrnFtKGQ+KuqK0RcTsNTm/C+SSGCiLmZ62TUQAQa7e0HpgkLUq tUOQ== X-Gm-Message-State: AOJu0YyuIwS62AfRvADe4YaPbzSGNVOOd88ko94Huygj5gFrFamT3drN GpheusZXEg8K6ntsYmc9UlLHSwKK7CMjch1Ja7QLDG+DlXMqe5qBLK7cJatqZjkztOpsDspHmMg 5qDHtDM3Hj0jLkg2BlfufMLCekBBotkcjGSCbx3YTvYyqTMSZYBaxlfO6/xNfTq2W74qG7b0YxK F9jkIqL9HR+Vp/nlChyoat2hQJPU/tQJbH7O0E X-Received: by 2002:a05:6402:2354:b0:5a2:a0d9:c1a2 with SMTP id 4fb4d7f45d1cf-5bea1cad0damr102262a12.26.1723568776191; Tue, 13 Aug 2024 10:06:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzsM50zCb89/RGNNWmZqNRMHD0zqp5+0Wk7Sa/qvkIIWqFubrprvfAZomrRgjuwBQlsXB67g== X-Received: by 2002:a05:6402:2354:b0:5a2:a0d9:c1a2 with SMTP id 4fb4d7f45d1cf-5bea1cad0damr102238a12.26.1723568775739; Tue, 13 Aug 2024 10:06:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Alexander Ivanov , Claudio Fontana , "Denis V. Lunev" , qemu-stable@nongnu.org Subject: [PULL 5/6] module: Prevent crash by resetting local_err in module_load_qom_all() Date: Tue, 13 Aug 2024 19:05:54 +0200 Message-ID: <20240813170556.104193-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240813170556.104193-1-pbonzini@redhat.com> References: <20240813170556.104193-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.125, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1723568858836116600 Content-Type: text/plain; charset="utf-8" From: Alexander Ivanov Set local_err to NULL after it has been freed in error_report_err(). This avoids triggering assert(*errp =3D=3D NULL) failure in error_setv() when local_err is reused in the loop. Signed-off-by: Alexander Ivanov Reviewed-by: Claudio Fontana Reviewed-by: Denis V. Lunev Link: https://lore.kernel.org/r/20240809121340.992049-2-alexander.ivanov@vi= rtuozzo.com [Do the same by moving the declaration instead. - Paolo] Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- util/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c7..3eb0f06df16 100644 --- a/util/module.c +++ b/util/module.c @@ -354,13 +354,13 @@ int module_load_qom(const char *type, Error **errp) void module_load_qom_all(void) { const QemuModinfo *modinfo; - Error *local_err =3D NULL; =20 if (module_loaded_qom_all) { return; } =20 for (modinfo =3D module_info; modinfo->name !=3D NULL; modinfo++) { + Error *local_err =3D NULL; if (!modinfo->objs) { continue; } --=20 2.46.0