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 84093C83F14 for ; Wed, 30 Aug 2023 09:40:37 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4Jw5U2rNrkStTF+fWnLZEkqLfIEsilQnn5MxDuYNBNc=; b=v0CYZdAuFDytQk khoc2cLlVBKCKV+JRpgildEz2OfQROZVC3gq+IHyK5IOF2n1zT9Qt7LUoEapneav+RNCBag0SOb94 TnmXyHVOHB4bCJCEn6WZXBgU9lUbzbXz8H5njjSZFlRk3Px2gjPEmtCVHnhjSidJHF93FZohBUiPl GzA1xwc7jrPdpcemkWLEOww/uYgmlkeEix5fIEjGBs8QYelVR/PPZzs8zyludCTm2rjkUtMT3uoM/ ApmGuYAEeMaN/Hzi3VHSDHL7pdrpYvLpnfgqavTogxhOi8RfJ5DW+kwNwEzMTqtani5KsP+1rwwdR ey6PcUgYq0Bm77GSiUgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbHgE-00D9rj-21; Wed, 30 Aug 2023 09:40:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbHgC-00D9qx-0j for linux-arm-kernel@lists.infradead.org; Wed, 30 Aug 2023 09:40:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B2F52F4; Wed, 30 Aug 2023 02:40:40 -0700 (PDT) Received: from bogus (unknown [10.57.36.157]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C39DF3F64C; Wed, 30 Aug 2023 02:39:59 -0700 (PDT) Date: Wed, 30 Aug 2023 10:39:02 +0100 From: Sudeep Holla To: Qiujun Huang Cc: cristian.marussi@arm.com, linux-arm-kernel@lists.infradead.org, Sudeep Holla , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] firmware: arm_scmi: Fix NULL pointer dereference in mailbox_clear_channel Message-ID: <20230830093902.duvvjimgwddh7qbt@bogus> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_024004_338073_8E26AB46 X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. 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 Wed, Aug 30, 2023 at 01:07:47AM +0800, Qiujun Huang wrote: > There is a race between the failure of probe and rx_callback (due to a > delayed response). > > scmi_probe > scmi_acquire_protocal > do_xfer > timeout > mailbox_chan_free > <--- delay response > rx_callback > mbox_free_channel > cinfo->transport_info = NULL > mailbox_clear_channel > dereference cinfo->transport_info It is always good to provide the kernel stacktrace which you get when a NULL pointer is dereference. It helps for review and also to document it. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel