From nobody Mon Feb 2 05:57:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=flant.com ARC-Seal: i=1; a=rsa-sha256; t=1769422640; cv=none; d=zohomail.com; s=zohoarc; b=fU8WxYLXDj47FBeM8dXXGa9vsvLLA2/2FOa/T6qJPKXKsn9H63vO/gDr/S+hjJ5DIrWFzlmf+5K9C9FFEqmTgEUFkzm/2dn9Qp24QMqKSCOqfsxe1jtKF2DAsJdclcxxlzpeIgQz4MkWCKjokdR7DECDh5SxRsEHn0nB0Sd4pMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769422640; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZvqjpoSIMsqdBHzazCA4RM3xkMyU48rNsy16cniRlWs=; b=VjqGrko7fEIzyFHaNq2mV0u13THbquGBCZ98hxxScxPalHBY6uXPj2HarWXKAqzPb4J3ucFlBoPpemHG/hGo6mQEiiZpUqTs8uUSlsVtOzRx4fjt4XcWXGPTlJxVb/l1ROUlL/EvdLYA0CRdRhAxIMold2unBVpluECOyuIK7e0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769422639677403.27984292282054; Mon, 26 Jan 2026 02:17:19 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 732B94199B; Mon, 26 Jan 2026 05:17:19 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 1EA9541B25; Mon, 26 Jan 2026 05:16:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id E6E9641A17; Wed, 21 Jan 2026 02:48:53 -0500 (EST) Received: from forward204a.mail.yandex.net (forward204a.mail.yandex.net [178.154.239.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 9F1EB41966 for ; Wed, 21 Jan 2026 02:48:51 -0500 (EST) Received: from forward100a.mail.yandex.net (forward100a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d100]) by forward204a.mail.yandex.net (Yandex) with ESMTPS id 9043682814 for ; Wed, 21 Jan 2026 10:41:42 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net [IPv6:2a02:6b8:c18:3e07:0:640:a874:0]) by forward100a.mail.yandex.net (Yandex) with ESMTPS id 0FA72C01EE for ; Wed, 21 Jan 2026 10:41:33 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id RfV2GJ7GrCg0-RCdOe0Jm; Wed, 21 Jan 2026 10:41:32 +0300 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Greylist: delayed 431 seconds by postgrey-1.37 at lists.libvirt.org; Wed, 21 Jan 2026 02:48:51 EST X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flant.com; s=mail; t=1768981292; bh=ZvqjpoSIMsqdBHzazCA4RM3xkMyU48rNsy16cniRlWs=; h=Message-Id:Date:Cc:Subject:To:From; b=xTAggY4z4O3jHoAixm4igi+Rpd+G31B2AOpI0+BHhDebd0Iz2Yn6PS2CjxZ8KywW9 y+e55f6CBqLSO6aU/sN0YEksFhurLifz2Dk070oA8kgxLIMqYHuT08wprBb3SWhhGl tM/8DTtTuu3rRcWX6jJ5codwwPeCyWlS0P9BJbqM= Authentication-Results: mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net; dkim=pass header.i=@flant.com From: Dmitry Lopatin To: devel@lists.libvirt.org Subject: [PATCH] virt-aa-helper: Fix unchecked return values Date: Wed, 21 Jan 2026 10:41:25 +0300 Message-Id: <20260121074125.159525-1-dmitry.lopatin@flant.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: dmitry.lopatin@flant.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation Message-ID-Hash: U62NSFYYGAL7666IT73O2GIJ6NUGJ7UA X-Message-ID-Hash: U62NSFYYGAL7666IT73O2GIJ6NUGJ7UA X-Mailman-Approved-At: Mon, 26 Jan 2026 10:16:29 +0000 CC: Dmitry Lopatin X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @flant.com) X-ZM-MESSAGEID: 1769422641657158500 Content-Type: text/plain; charset="utf-8" Add missing return value checks to fix the following issues reported by the static analyzer: - vah_add_file() call when adding render node path to the AppArmor profile (line 1029) was not checked, while there are examples with return code check throughout the code. - vah_add_file() call when adding default render node path (line 1037) had the same issue. - virDriverLoadModule() call when loading the storage driver (line 908) was not checked, while there are examples with return code check throughout the code. Signed-off-by: Dmitry Lopatin --- src/security/virt-aa-helper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 067a17f331..07e5882237 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -905,7 +905,8 @@ get_files(vahControl * ctl) =20 /* load the storage driver so that backing store can be accessed */ #ifdef WITH_STORAGE - virDriverLoadModule("storage", "storageRegister", false); + if (virDriverLoadModule("storage", "storageRegister", false) < 0) + goto cleanup; #endif =20 for (i =3D 0; i < ctl->def->ndisks; i++) { @@ -1026,7 +1027,8 @@ get_files(vahControl * ctl) const char *rendernode =3D virDomainGraphicsGetRenderNode(graphics= ); =20 if (rendernode) { - vah_add_file(&buf, rendernode, "rw"); + if (vah_add_file(&buf, rendernode, "rw") !=3D 0) + goto cleanup; needsgl =3D true; } else { if (virDomainGraphicsNeedsAutoRenderNode(graphics)) { @@ -1034,7 +1036,8 @@ get_files(vahControl * ctl) needsgl =3D true; =20 if (defaultRenderNode) { - vah_add_file(&buf, defaultRenderNode, "rw"); + if (vah_add_file(&buf, defaultRenderNode, "rw") !=3D 0) + goto cleanup; VIR_FREE(defaultRenderNode); } } --=20 2.34.1