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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C3ECDD35677 for ; Wed, 28 Jan 2026 05:47:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 385D610E034; Wed, 28 Jan 2026 05:47:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ktUD6Zjg"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9EA410E034 for ; Wed, 28 Jan 2026 05:47:51 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 6004D41B5B; Wed, 28 Jan 2026 05:47:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9A74C4CEF1; Wed, 28 Jan 2026 05:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769579271; bh=nn8J0fTe8eO8RxDRcoCwqPLIJnx2dWT1IczIeSUPTUc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ktUD6ZjgnmOIDGMEiIOPszX4E+0j5yjMO+8No5JAGcT9SjvTTQfHoKMqsFDz2jc3n +xxixDOfLTUA0hrknfrlNjJfNRi7VCo5OG4in2wXh7PYUv2MYZU8gTXf2iicYoshpM Z819y4IJtIuuqjhL5By5QBHmDUIpjfWD61cWDx0U= Date: Wed, 28 Jan 2026 06:47:47 +0100 From: Greg KH To: Xingjing Deng Cc: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Xingjing Deng , stable@vger.kernel.org Subject: Re: [PATCH v6] misc: fastrpc: check qcom_scm_assign_mem() return in rpmsg_probe Message-ID: <2026012814-ignition-stiffly-cd0d@gregkh> References: <20260128033454.2614886-1-xjdeng@buaa.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260128033454.2614886-1-xjdeng@buaa.edu.cn> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Jan 28, 2026 at 11:34:54AM +0800, Xingjing Deng wrote: > In the SDSP probe path, qcom_scm_assign_mem() is used to assign the > reserved memory to the configured VMIDs, but its return value was not checked. > > Fail the probe if the SCM call fails to avoid continuing with an > unexpected/incorrect memory permission configuration. > > This issue was detected by a private static analysis tool. > No actual hardware testing was performed as the issue is purely > code-level and verified via static analysis. > > Fixes: c3c0363bc72d4 ("misc: fastrpc: support complete DMA pool access to the DSP") > Cc: stable@vger.kernel.org # 6.11-rc1 > Signed-off-by: Xingjing Deng > --- > v6: > - Add description of the detection tool. > - Link to v5: https://lore.kernel.org/linux-arm-msm/20260117140351.875511-1-xjdeng@buaa.edu.cn/T/#u > > v5: > - Squash the functional change and indentation fix into a single patch. > - Link to v4: https://lore.kernel.org/linux-arm-msm/2026011637-statute-showy-2c3f@gregkh/T/#t > > v4: > - Format the indentation > - Link to v3: https://lore.kernel.org/linux-arm-msm/20260113084352.72itrloj5w7qb5o3@hu-mojha-hyd.qualcomm.com/T/#t > > v3: > - Add missing linux-kernel@vger.kernel.org to cc list. > - Standarlize changelog placement/format. > - Link to v2: https://lore.kernel.org/linux-arm-msm/20260113063618.e2ke47gy3hnfi67e@hu-mojha-hyd.qualcomm.com/T/#t > > v2: > - Add Fixes: and Cc: stable tags. > - Link to v1: https://lore.kernel.org/linux-arm-msm/20260113022550.4029635-1-xjdeng@buaa.edu.cn/T/#u > --- > drivers/misc/fastrpc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c > index ee652ef01534..8bac2216cb20 100644 > --- a/drivers/misc/fastrpc.c > +++ b/drivers/misc/fastrpc.c > @@ -2337,8 +2337,11 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) > if (!err) { > src_perms = BIT(QCOM_SCM_VMID_HLOS); > > - qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms, > + err = qcom_scm_assign_mem(res.start, resource_size(&res), &src_perms, > data->vmperms, data->vmcount); > + if (err) { > + goto err_free_data; > + } > } > > } > -- > 2.25.1 > > Always run checkpatch.pl on your changes so that you don't get grumpy maintainers asking why you didn't run checkpatch.pl on your change :) thanks, greg k-h