All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shawn Guo" <shengchao.guo@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 4/8] rpmsg: qcom_glink_ssr: Suppress cleanup notify between cluster siblings
Date: Sat, 15 Aug 2026 13:36:54 +0000	[thread overview]
Message-ID: <20260815133655.11D001F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260815132541.1575121-5-shengchao.guo@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Type confusion and out-of-bounds read when `qcom_glink_ept_cluster()` downcasts a generic `rpmsg_endpoint` without checking its transport backend.
--

--- Patch [4]: [PATCH 4/8] rpmsg: qcom_glink_ssr: Suppress cleanup notify between cluster siblings ---
commit c10027dd4bbd2c7fac42077955228324a4275d43
Author: Shawn Guo <shengchao.guo@oss.qualcomm.com>

rpmsg: qcom_glink_ssr: Suppress cleanup notify between cluster siblings

This commit passes the remote processor's cluster identifier down to the
GLINK edges and uses it to skip sending cleanup broadcast messages to other
members of the same cluster during start/stop events.

> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index d9d4468e4cbdf..a15d7e6a52423 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
[ ... ]
> @@ -1940,6 +1944,20 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(qcom_glink_native_probe);
>  
> +/**
> + * qcom_glink_ept_cluster() - cluster identifier of an endpoint's edge
> + * @ept:	endpoint to query
> + *
> + * Return: the opaque cluster identifier of the remote processor @ept talks to,
> + * or NULL if it is not part of a cluster.
> + */
> +void *qcom_glink_ept_cluster(struct rpmsg_endpoint *ept)
> +{
> +	struct glink_channel *channel = to_glink_channel(ept);
> +
> +	return channel->glink->cluster;
> +}

[Severity: High]
Does this downcast assume that the endpoint is always backed by the GLINK
transport without verifying it?

If a remote processor on a different bus (such as virtio_rpmsg_bus) sends a
Name Service announcement for a channel named glink_ssr, the rpmsg core
could probe the qcom_glink_ssr_driver and store a non-GLINK endpoint.

Later, when a remoteproc stops, qcom_glink_ssr_notifier_call() would pass
this non-GLINK endpoint to qcom_glink_ept_cluster():

qcom_glink_ssr_notifier_call()
  cluster = qcom_glink_ept_cluster(ssr->ept);

Could this blind cast to struct glink_channel and subsequent dereference
of channel->glink->cluster cause a kernel panic or out-of-bounds read?

> diff --git a/drivers/rpmsg/qcom_glink_ssr.c b/drivers/rpmsg/qcom_glink_ssr.c
> index e71d3716c55c5..74c671a19af03 100644
> --- a/drivers/rpmsg/qcom_glink_ssr.c
> +++ b/drivers/rpmsg/qcom_glink_ssr.c
[ ... ]
> @@ -100,18 +120,24 @@ static int qcom_glink_ssr_notifier_call(struct notifier_block *nb,
>  					void *data)
>  {
>  	struct glink_ssr *ssr = container_of(nb, struct glink_ssr, nb);
> +	struct glink_ssr_notify_data *notify_data = data;
>  	struct do_cleanup_msg msg;
> -	char *ssr_name = data;
> +	void *cluster;
>  	int ret;
>  
> +	/* Cluster siblings' firmware can't handle peer SSR notify; skip it */
> +	cluster = qcom_glink_ept_cluster(ssr->ept);
> +	if (cluster && cluster == notify_data->cluster)
> +		return NOTIFY_DONE;
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com?part=4

  reply	other threads:[~2026-08-15 13:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 13:25 [PATCH 0/8] remoteproc: qcom: Support the Nord HPASS ADSP cluster Shawn Guo
2026-08-15 13:25 ` [PATCH 1/8] dt-bindings: remoteproc: qcom,nord-pas: Add qcom,cluster-root property Shawn Guo
2026-08-15 13:35   ` sashiko-bot
2026-08-15 13:25 ` [PATCH 2/8] remoteproc: Add cluster field to struct rproc Shawn Guo
2026-08-15 13:25 ` [PATCH 3/8] remoteproc: qcom: sysmon: Suppress notify between cluster siblings Shawn Guo
2026-08-15 13:33   ` sashiko-bot
2026-08-15 13:25 ` [PATCH 4/8] rpmsg: qcom_glink_ssr: Suppress cleanup " Shawn Guo
2026-08-15 13:36   ` sashiko-bot [this message]
2026-08-15 13:25 ` [PATCH 5/8] remoteproc: qcom: pas: Track HPASS ADSP cluster membership Shawn Guo
2026-08-15 13:25 ` [PATCH 6/8] remoteproc: qcom: pas: Sequence HPASS ADSP cluster boot root-first Shawn Guo
2026-08-15 13:34   ` sashiko-bot
2026-08-15 13:25 ` [PATCH 7/8] remoteproc: qcom: pas: Enforce coupled stop/crash for HPASS ADSP clusters Shawn Guo
2026-08-15 13:39   ` sashiko-bot
2026-08-15 13:25 ` [PATCH 8/8] remoteproc: qcom: pas: Add Nord ADSP1/2 support Shawn Guo

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=20260815133655.11D001F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shengchao.guo@oss.qualcomm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.