From: Greg KH <gregkh@linuxfoundation.org>
To: Xingjing Deng <micro6947@gmail.com>
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 <xjdeng@buaa.edu.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH v6] misc: fastrpc: check qcom_scm_assign_mem() return in rpmsg_probe
Date: Wed, 28 Jan 2026 06:47:47 +0100 [thread overview]
Message-ID: <2026012814-ignition-stiffly-cd0d@gregkh> (raw)
In-Reply-To: <20260128033454.2614886-1-xjdeng@buaa.edu.cn>
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 <xjdeng@buaa.edu.cn>
> ---
> 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
next prev parent reply other threads:[~2026-01-28 5:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 3:34 [PATCH v6] misc: fastrpc: check qcom_scm_assign_mem() return in rpmsg_probe Xingjing Deng
2026-01-28 5:47 ` Greg KH [this message]
2026-01-28 5:48 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026012814-ignition-stiffly-cd0d@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=amahesh@qti.qualcomm.com \
--cc=arnd@arndb.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=micro6947@gmail.com \
--cc=srini@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xjdeng@buaa.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox