From nobody Tue May 14 13:39:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1653238781; cv=none; d=zohomail.com; s=zohoarc; b=AiZQn8lihtX3di7NF9SGD0bprETOve4RwKWSWj7ZARV5cWMyLGVc9O6HHgZTEXs3j5ZLkXLb6uhYMbLNMb5xT7HYrsyj64ghSJ11+vM3XZzMkdEOgMpfo7NMldJNobN2geuD6LMCY2HuxdJ/HY5MnxoYJvCfilTjGvhWefE6sTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653238781; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2OHKG4CNbHIABlE0qBztVW9rVs14MrnSgfvgveIJfz4=; b=PLM2M+qhl3Im3nLDD9BhCd3jjyMiACSMOtaQ/IUY/xLCiD2HZCCHLGoW9LDHU0KVF8IsLFZHG4fMhNwk5kI/wAeQXK8rq4K1RhNwPH11nrMfZpSLRgwq8tPRZy7R00eBOAvAeJWo44ALKxBfRzwFtdtJCcPjF7u4WDeSrCCBl6U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1653238781172303.9629963928961; Sun, 22 May 2022 09:59:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335180.559317 (Exim 4.92) (envelope-from ) id 1nsov7-0001Ak-B6; Sun, 22 May 2022 16:59:09 +0000 Received: by outflank-mailman (output) from mailman id 335180.559317; Sun, 22 May 2022 16:59:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nsov7-0001Ad-8C; Sun, 22 May 2022 16:59:09 +0000 Received: by outflank-mailman (input) for mailman id 335180; Sun, 22 May 2022 16:59:07 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nsov5-0001AX-KI for xen-devel@lists.xenproject.org; Sun, 22 May 2022 16:59:07 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nsov5-0003kU-HT; Sun, 22 May 2022 16:59:07 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nsov5-0007oz-8o; Sun, 22 May 2022 16:59:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=2OHKG4CNbHIABlE0qBztVW9rVs14MrnSgfvgveIJfz4=; b=vn91Za +LRukmHabTBmMjPQTvan6t9BHUGjRiGadxUAfoO26ziG8Za1t9s6jaQHArGatwZ3tk8cIBW8Iy2nE 6/WFiqXKRkEt8t9I4OWgjKcWmLuNK/GlQkzmUy/iNjuzU1cOH12p0JdlEcCA4PCWYVB1Cok/Bu6Fy Yxv+Pc/TTNI=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Stefano Stabellini Subject: [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice() Date: Sun, 22 May 2022 17:59:00 +0100 Message-Id: <20220522165900.83104-1-julien@xen.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1653238782931100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall xsm_deasign_dtdevice() will indicate whether the caller is allowed to issue the operation. So the return value has to be checked. Spotted by clang static analyzer. Fixes: fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to = support DT device") Signed-off-by: Julien Grall Reviewed-by: Bertrand Marquis Reviewed-by: Michal Orzel --- Platform device-passthrough is not security supported. Hence why this is sent directly to xen-devel. --- xen/drivers/passthrough/device_tree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthroug= h/device_tree.c index 98f2aa0dad68..1c32d7b50cce 100644 --- a/xen/drivers/passthrough/device_tree.c +++ b/xen/drivers/passthrough/device_tree.c @@ -269,6 +269,8 @@ int iommu_do_dt_domctl(struct xen_domctl *domctl, struc= t domain *d, break; =20 ret =3D xsm_deassign_dtdevice(XSM_HOOK, d, dt_node_full_name(dev)); + if ( ret ) + break; =20 if ( d =3D=3D dom_io ) return -EINVAL; --=20 2.32.0