From nobody Sat Jun 13 06:07:05 2026 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (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 54D9721CFE0 for ; Sat, 9 May 2026 13:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778333046; cv=none; b=HStAb/8WiEUCQyxi89vss7CwA/TQ/aLfSpHSj7QDm9i0ZX+mm4+YnbDFiEveodAlKV8ioo4mxLSBG1/PezQWDtZKQC6z24g5zQAcqHVrfAbA5yaDkA02EwTsoSij9fE+GfHKf2quZlaMGdNOxEX3f+fqCz4IcpTqMomUlncmsFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778333046; c=relaxed/simple; bh=PfZvGd2mCx1I8ClxHyPLNvotnqBavvUnmNb5NnOmgOw=; h=From:To:Cc:Subject:Date:Message-Id; b=HeOPhBDdPeT/8YzfsmhPQjchwQeO563pk0lIW7QTvnfW6dRFRJyZarqkhySyKRSfOVijBVtwerLsW2W2fVgzR+tOaKXdKHfyx+YryFEJ55pcTKt36h5oNpQEsVsrnAmcsHBC3rZzhNy1BYONgb1EGD2x5QdHlukLXOqSpARbwqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 939CD1A3B29; Sat, 9 May 2026 15:24:03 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5C1411A3B28; Sat, 9 May 2026 15:24:03 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 29F8418002D1; Sat, 9 May 2026 21:24:02 +0800 (+08) From: Zhiqiang Hou To: linux-kernel@vger.kernel.org, jassisinghbrar@gmail.com, Jiafei.Pan@nxp.com Cc: Hou Zhiqiang Subject: [PATCH] mailbox: make the channel receive function robust Date: Sat, 9 May 2026 21:26:32 +0800 Message-Id: <20260509132632.11206-1-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hou Zhiqiang Mailbox may receive fake messages on a channel without binding to a client, this can result in kernel crash. Signed-off-by: Hou Zhiqiang --- drivers/mailbox/mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index bbc9fd75a95f7..1febfac5a85dd 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -145,7 +145,7 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtim= er *hrtimer) void mbox_chan_received_data(struct mbox_chan *chan, void *mssg) { /* No buffering the received data */ - if (chan->cl->rx_callback) + if (chan->cl && chan->cl->rx_callback) chan->cl->rx_callback(chan->cl, mssg); } EXPORT_SYMBOL_GPL(mbox_chan_received_data); --=20 2.43.0