Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp865233lqp; Thu, 21 Mar 2024 19:38:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2M9vDXs1MAKAL/Iogbq/NInBmyRbnxxE/bV11vtmVHqWlCbPXi4yJHfva9rhdFuCBAZN8XJSKT0y4NEXywqA92h4v+RtiMQ2cUmM5PQ== X-Google-Smtp-Source: AGHT+IEe7wPVVFR0oNj3yyxlWUq1OiRhfILEgyZzBdhY+uh7yn4aTmxdrCgUCyKD+zLl9ozZqhYZ X-Received: by 2002:a50:8ade:0:b0:56a:2ca3:ea4e with SMTP id k30-20020a508ade000000b0056a2ca3ea4emr610312edk.18.1711075111995; Thu, 21 Mar 2024 19:38:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711075111; cv=pass; d=google.com; s=arc-20160816; b=Q89TEI9R8Rur1oLd+2Y7hrcyT6vYmLv0r0HhALmAEyIZ1jT6GA37xVTuIXZ0wW85Y7 +lwH7m2YSwpax5OzlC0f8R9N/TTZgb1P6TgFUXHvFfE+uccCeCnX7tQe3Od6/K00i6T8 wp1ku5wx+9/ePvNFlZm0aTIPzIbAlKMnVVDKuJnxaLxtWY0FjDv1puDO1ffIo71s02Pg PyZFuxKDPUgJ9p5bnoFSfy8LAq1KYc9UKAkQ4pOET+GMi4PK9CDcnFiBalaTm9eRk3PM NI4zCqoyaOH/6787gUjIdNbErh8MI9eY17umlyXKEscIEnLdzVKERqMM729RdRpzuFxG 4prQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/BKF+Lmv7DzWepLEL6NR0Sdzy44W84qh6o/ulQjR0Lk=; fh=31JcbotzVW5eY2L9mh5OT/ZFqP/8owlMZhXfdYbqCtM=; b=WFIOQPOwHnM3rtbzneU0L35htIy2KEkDcgetJWVsmjz2IIqxwgyeWWmusqh8xuVCr/ lBupYfOESwleOZuRMgOtWDjLLtY7djBacr9k564Di5XF/FET7+sIwqBDAXSrlP7dUXO9 EQNWkyVysF8n81GCCdEZdngOZ0RMntXTOOk1yJdtd5sJ6zHdxpfY9ssrEoruAMw4+n4g YKGZgjm4NG6S0Xtkh+i5NU8L2duqjXZ1QK9o3RTZ7ssth3/fPtD3GHmfINmA18JXFbhj NmTrLGwp1IDhrs0ui6d1ovClvXBcboiu39dIBRSvo3X4ONR32BMKalzcMUSO7ZZGM0o5 uwag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=ppHwERJ+; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-110884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=alibaba-inc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n18-20020a509352000000b0056869ae4414si450052eda.55.2024.03.21.19.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 19:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=ppHwERJ+; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-110884-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=alibaba-inc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B55281F23FCA for ; Fri, 22 Mar 2024 02:38:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93DD94A07; Fri, 22 Mar 2024 02:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="ppHwERJ+" Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DB3D387 for ; Fri, 22 Mar 2024 02:38:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711075102; cv=none; b=MuOGygoZAfnlbyVehHw04jrJEfjPmXK12l2x/sORydJ21VWSGwGBnhKr0wDMTFs7c1EJJPc8qGBNAvPj6HpCsKmfDX4kXhf3rmNSwxVe9iBIUQwXGBMU/b3AVwQ6+wk5MijE2qUB/V6QMG3gE+Kc/0AJhsDzE3yMwRZurFN3JQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711075102; c=relaxed/simple; bh=hbMBqp1L5tPgF5RfvNy4jdUY1gkApGXhR91Ftknm/J4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=otSJ/tt7xIMLVTkvfFOHwYUV4n9GXMU6StDTDjQkVx80QR/sV4j1jBwiX+iHveZqVON4tRkR65f8WSbzj5koDIsHvpyg0qyxX1xdU9kR9HWxYETWQTNNV8ssr2aGFbv0EF8yhqCU7Yw0XCGJ/5sChDqoBUL1Cr7gi+/1z/PF5EY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=alibaba-inc.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=ppHwERJ+; arc=none smtp.client-ip=115.124.30.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=alibaba-inc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1711075091; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=/BKF+Lmv7DzWepLEL6NR0Sdzy44W84qh6o/ulQjR0Lk=; b=ppHwERJ+4TfAS4YD0n482A7LLb932xQUhu+bii/B1tyL77ucXMHDfle5PEIsoqSvgeBs++z2ky5mrXvqSGe7uVYMCYpBQuYvg4Z7D1lyZiyeH0IL+YkmkquoyUWW/6VeqP+1yYlDMuIY99/DqwhecuGXbPNYSGoQFp9swhK4S4k= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=guanrui.huang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0W30Q322_1711075090; Received: from localhost(mailfrom:guanrui.huang@linux.alibaba.com fp:SMTPD_---0W30Q322_1711075090) by smtp.aliyun-inc.com; Fri, 22 Mar 2024 10:38:11 +0800 From: "huangguanrui.hgr" To: yuzenghui@huawei.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maz@kernel.org, shannon.zhao@linux.alibaba.com, tglx@linutronix.de Subject: Re: [PATCH] irqchip/gic-v3-its: Fix double free on error Date: Fri, 22 Mar 2024 10:38:10 +0800 Message-Id: <20240322023810.62914-1-huangguanrui.hgr@alibaba-inc.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We notice that: In its_vpe_irq_domain_alloc, its_vm is from args, But in its_vpe_irq_domain_free, its_vm is from domain->host_data. Will these two values be different? For example, when other bugs occur? If these two values is different, I think we can't handle these 2 cases together. if (err) its_vpe_irq_domain_free(domain, virq, i); Because these will lead a memleak. So I think that check the bitmap is a safe way to fix this. If bitmap is empty, that means its_vpe_irq_domain_free handles same its_vm which comes from its_vpe_irq_domain_alloc. Thanks, Guanrui