From: sashiko-bot@kernel.org
To: "Anvesh Jain P" <anvesh.p@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 3/4] remoteproc: qcom: pas: Add coredump support for secondary processors
Date: Thu, 15 Oct 2026 06:13:36 +0000 [thread overview]
Message-ID: <sashiko-outbox-172332@kernel.org> (raw)
In-Reply-To: <20261015-oob-support-glymur-v2-3-715435f52dd7@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] remoteproc: qcom: coredump completely aborted if secondary memory map fails
- [High] mm: UAF of rproc in qcom_pas_probe() if rproc_add() fails
--
commit 78eeb93e0081fe18e5c14c65d05d13fbc15c17c8
Author: Anvesh Jain P <anvesh.p@oss.qualcomm.com>
remoteproc: qcom: pas: Add coredump support for secondary processors
Add coredump support for PAS remoteproc instances with a secondary
processor by registering fixed dump segments for both primary and
secondary carveouts at probe time and mapping them during collection.
The attached-state path is for debug dump collection and does not
provide operational device recovery.
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index 0bce2f0d5b4aa..374cafd04b625 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
[ ... ]
> @@ -716,13 +772,21 @@ static void qcom_pas_coredump(struct rproc *rproc)
> {
> struct qcom_pas *pas = rproc->priv;
>
> - pas->mem_region = qcom_pas_ctx_map(pas->pas_ctx);
> + if (!pas->mem_region)
> + pas->mem_region = qcom_pas_ctx_map(pas->pas_ctx);
> if (!pas->mem_region)
> return;
>
> + if (qcom_pas_has_secondary(pas) && !pas->secondary_mem_region) {
> + pas->secondary_mem_region =
> + qcom_pas_ctx_map(pas->secondary_pas_ctx);
> + if (!pas->secondary_mem_region) {
> + dev_err(pas->dev, "unable to map secondary memory for coredump\n");
> + return;
> + }
> + }
> +
> rproc_coredump(rproc);
[Severity: High]
If the secondary memory mapping fails here, does the early return
unintentionally bypass the rproc_coredump() call completely?
Since the primary processor memory was successfully mapped just above,
and the remoteproc framework's segment copy gracefully handles unmapped
segments, should it log the error and still proceed to dump the primary
core's memory rather than aborting?
[ ... ]
> @@ -1133,6 +1197,12 @@ static int qcom_pas_probe(struct platform_device *pdev)
> if (desc->early_boot)
> pas->rproc->state = RPROC_DETACHED;
>
> + if (qcom_pas_has_secondary(pas)) {
> + ret = qcom_pas_register_dump_segments(rproc, pas);
> + if (ret)
> + goto remove_ssr_sysmon;
> + }
> +
> ret = rproc_add(rproc);
> if (ret)
> goto remove_ssr_sysmon;
> @@ -1144,6 +1214,7 @@ static int qcom_pas_probe(struct platform_device *pdev)
> return 0;
>
> remove_ssr_sysmon:
> + rproc_coredump_cleanup(rproc);
[Severity: High]
Can this sequence cause a use-after-free if rproc_add() fails?
Looking at rproc_add(), if device_add() fails internally, it explicitly
calls put_device() which drops the initial reference created by
devm_rproc_alloc(), freeing the rproc structure:
rproc_add() {
...
ret = device_add(dev);
if (ret < 0) {
put_device(dev);
goto rproc_remove_cdev;
}
...
}
If we jump to remove_ssr_sysmon on rproc_add() failure, doesn't
rproc_coredump_cleanup() then try to access the already freed
rproc structure?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-oob-support-glymur-v2-0-715435f52dd7@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-10-15 6:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 5:55 [PATCH v2 0/4] Add Glymur OOBMSS support Anvesh Jain P
2026-10-15 5:55 ` [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Add Glymur OOBMSS PAS Anvesh Jain P
2026-10-15 10:34 ` Krzysztof Kozlowski
2026-10-15 5:55 ` [PATCH v2 2/4] remoteproc: qcom: pas: Support secondary images Anvesh Jain P
2026-10-15 6:05 ` sashiko-bot
2026-10-15 9:57 ` Anvesh Jain P
2026-10-15 5:55 ` [PATCH v2 3/4] remoteproc: qcom: pas: Add coredump support for secondary processors Anvesh Jain P
2026-10-15 6:13 ` sashiko-bot [this message]
2026-10-15 5:55 ` [PATCH v2 4/4] remoteproc: qcom: pas: Add Glymur OOBMSS PAS parameters Anvesh Jain P
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=sashiko-outbox-172332@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=anvesh.p@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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