From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2E65CD1284 for ; Thu, 11 Apr 2024 13:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Rvu35gbKluwl2ybdJOw2hrLrGSAWUw8McCekauY1Yo=; b=JrHzr+L3mmNf1f hz70ZFcquTRpsLxOggY2l8UKGQ9nkOD/CJDB9O5Y/VAmRo83XAjXOaJU9XXcAuQA3XlwfX6dZUlJ7 r6oojELcNCfR8eCTO2wUfZ/Gbk03DAJGAFlLXKUPO405YfAlWVyX+rA2kR3EKT+wyE1jYGOOg0oMN FM2yPW4eT6AInUbmCAy7eWAZ2RDG+f4jGhCEioIr5bkA6zBIWHEWgBTda5k6DYlBO6xEQVNzHIDYd KzOiQjyn+E2lT9U1ocit2Eu3j3KOcKLFDM8NqoSuFF75Hp0gOgBNx/iXbttf4o2oTTUf5ZBT6hdeu pSGWaYAnCB9Ufw//BEBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruu3B-0000000C3d5-12hh; Thu, 11 Apr 2024 13:01:09 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruu32-0000000C3bX-06Uz for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2024 13:01:03 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CE2F1CE2E76; Thu, 11 Apr 2024 13:00:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A1F7C43390; Thu, 11 Apr 2024 13:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712840457; bh=98TrFhUIOGBPLgvKQW9yiisACadTMu7wmvJOzNKD9mg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lLvYw14kjYbXUT/XD6jSaVNTNMrZ8qsDrIN+dhsW5GS1vLg75iHBz+EiNxAWF6bZA +DDpzPLfMKK/EZumhAKlCXuWZDmfs9N5oI8R/g+8aBxefLYu5NvwZ9bqfIfoFRMeTR 416KlX1mEYk4y3T6EdmVgxMxfRJN+0J1vUvN6AUDnQzXwUlEuXiXFnTEPF8F+zRz5w mCNEU6hPzukTUNpSkVUMcMGLzP8goIMtfJePBCxdTVrfkAlGSVyBqDHGscsnywBskw g1/YdcdwgiwN7DikS9Scofv1kN3GB3FW4mgzsO2I/MNopOQmWawIXExW/J/LcbVEzB bB/GPNi5mQaJQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ruu2w-003Twy-N3; Thu, 11 Apr 2024 14:00:54 +0100 Date: Thu, 11 Apr 2024 14:00:53 +0100 Message-ID: <86pluwrr3u.wl-maz@kernel.org> From: Marc Zyngier To: Guanrui Huang Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, shannon.zhao@linux.alibaba.com, tglx@linutronix.de, yuzenghui@huawei.com Subject: Re: [PATCH v2] irqchip/gic-v3-its: Fix double free on error In-Reply-To: <20240411115805.115673-1-guanrui.huang@linux.alibaba.com> References: <86r0fcrvsz.wl-maz@kernel.org> <20240411115805.115673-1-guanrui.huang@linux.alibaba.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: guanrui.huang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, shannon.zhao@linux.alibaba.com, tglx@linutronix.de, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_060100_273021_3A0799B5 X-CRM114-Status: GOOD ( 14.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 11 Apr 2024 12:58:05 +0100, Guanrui Huang wrote: > > if (vm != domain->host_data) > > This is just a safety check. It looks unlikely happened. It's not a safety check. It is just papering over problems. If you don't trust the vm pointer, why do you trust the domain pointer? Why do you trust *anything* at all? > After all, vm is obtained from the args. If the caller has a bug, > can we check here to avoid possible problems that may arise in later > code? If the caller has a bug, please fix the caller. Don't paper over it. And you can remove the BUG_ON(!vm) which is equally useless. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel