From nobody Mon May 6 11:10:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568052737; cv=none; d=zoho.com; s=zohoarc; b=AJpmR0lKFz4gXMlSGR5QV8tgKmaBYL3l+WYEwf3HWHSUujChRCBDf4+VKKnZDua0TcnQsS2r9kMBjOdAfwhG5x5hQrBvG5PPoRxxiWq00mbaq4TorNwENDPszPt2dZY8vG7/Hab1l3oj0m4Jw4Ilcq5kjxfujhpHAYKd9D3atGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568052737; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=i2+wbJBeG3C3b41gffPflVgXiXRJEhfmkHRDr+OnvME=; b=G2Ni+1dUfxoBk5GEDPjn2/oBP/wZsPqSll7nVA4xJtqzrIaZhVJUYKkzAdEA/sZFaxyTg0fyRR2bs52e5zBG7GWR0ARI8wHF1uDM+XJtQhxUSPHe8QVMaHVS7dZH3270g2aAabnE3IeFANXL1swaYsKj8PhSBNu89HFyIhnjwIc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568052737597997.7560495591025; Mon, 9 Sep 2019 11:12:17 -0700 (PDT) Received: from localhost ([::1]:59858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7O93-0002f6-9Z for importer@patchew.org; Mon, 09 Sep 2019 14:12:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56668) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7O7H-0001be-I4 for qemu-devel@nongnu.org; Mon, 09 Sep 2019 14:10:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7O7G-0007qP-2k for qemu-devel@nongnu.org; Mon, 09 Sep 2019 14:10:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58490 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7O7F-0007mr-Sd for qemu-devel@nongnu.org; Mon, 09 Sep 2019 14:10:17 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x89I6x8b025836 for ; Mon, 9 Sep 2019 14:10:16 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uwu0vsr2g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Sep 2019 14:10:16 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Sep 2019 19:10:14 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 9 Sep 2019 19:10:10 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x89I9jM240567130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Sep 2019 18:09:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B41C85204F; Mon, 9 Sep 2019 18:10:09 +0000 (GMT) Received: from bahia.lan (unknown [9.145.60.118]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 765BD52051; Mon, 9 Sep 2019 18:10:09 +0000 (GMT) From: Greg Kurz To: David Gibson Date: Mon, 09 Sep 2019 20:10:09 +0200 User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19090918-0016-0000-0000-000002A8EFBC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19090918-0017-0000-0000-0000330972AE Message-Id: <156805260916.1779401.11054185183758185247.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-09_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=787 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909090184 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH] spapr-tpm-proxy: Drop misleading check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Michael Roth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Coverity is reporting in CID 1405304 that tpm_execute() may pass a NULL tpm_proxy->host_path pointer to open(). This is based on the fact that h_tpm_comm() does a NULL check on tpm_proxy->host_path and then passes tpm_proxy to tpm_execute(). The check in h_tpm_comm() is abusive actually since a spapr-proxy-tpm requires a non NULL host_path property, as checked during realize. Fixes: 0fb6bd073230 Signed-off-by: Greg Kurz Reviewed-by: Michael Roth --- hw/ppc/spapr_tpm_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_tpm_proxy.c b/hw/ppc/spapr_tpm_proxy.c index b835d25be6f6..ca1caec113f0 100644 --- a/hw/ppc/spapr_tpm_proxy.c +++ b/hw/ppc/spapr_tpm_proxy.c @@ -114,7 +114,7 @@ static target_ulong h_tpm_comm(PowerPCCPU *cpu, return H_FUNCTION; } =20 - trace_spapr_h_tpm_comm(tpm_proxy->host_path ?: "null", op); + trace_spapr_h_tpm_comm(tpm_proxy->host_path, op); =20 switch (op) { case TPM_COMM_OP_EXECUTE: