All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Amirreza Zarrabi" <amirreza.zarrabi@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 01/10] mailbox: add direct synchronous send support
Date: Tue, 29 Sep 2026 03:31:08 +0000	[thread overview]
Message-ID: <20260929033109.27C091F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928-riscv-rpmi-tee-abi-v1-1-04908b81d885@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mailbox: missing validation of send_data allows NULL dereference
--

commit 4e6ec78e9c624fa338c55d686383cecee65b8cdb
Author: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>

mailbox: add direct synchronous send support

Some mailbox controllers can complete a transaction entirely within
the calling context, without going through the queued TX state
machine or a TX-done interrupt. Add a synchronous send path so their
clients can request one and wait for the result directly.

> diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
> index efacd24a085d1..c640b19de6080 100644
> --- a/drivers/mailbox/mailbox.c
> +++ b/drivers/mailbox/mailbox.c

[ ... ]

> @@ -355,6 +412,14 @@ static int __mbox_bind_client(struct mbox_chan *chan, struct mbox_client *cl)
>  	struct device *dev = cl->dev;
>  	int ret;
>  
> +	if (cl->tx_sync) {
> +		if (!chan->mbox->ops->send_data_sync)
> +			return -EOPNOTSUPP;
> +
> +		if (cl->tx_block || cl->tx_tout || cl->knows_txdone)
> +			return -EINVAL;
> +	}
> +

[Severity: Medium]
If a controller only provides send_data_sync (a synchronous-only controller),
and an asynchronous client without cl->tx_sync set binds to it, shouldn't we
also validate the presence of the legacy send_data op?

If an async client binds to a synchronous-only controller, it appears it
could later result in a NULL pointer dereference when sending a message:

drivers/mailbox/mailbox.c:msg_submit() {
    ...
    err = chan->mbox->ops->send_data(chan, data);
    ...
}

>  	if (chan->cl || !try_module_get(chan->mbox->dev->driver->owner)) {
>  		dev_err(dev, "%s: mailbox not free\n", __func__);
>  		return -EBUSY;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928-riscv-rpmi-tee-abi-v1-0-04908b81d885@oss.qualcomm.com?part=1

  reply	other threads:[~2026-09-29  3:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  3:16 [PATCH RFC 00/10] firmware: riscv: add RPMI TEE service group transport Amirreza Zarrabi
2026-09-29  3:16 ` Amirreza Zarrabi
2026-09-29  3:16 ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:16 ` [PATCH RFC 01/10] mailbox: add direct synchronous send support Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:31   ` sashiko-bot [this message]
2026-09-29  3:16 ` [PATCH RFC 02/10] mailbox: mpxy: add direct synchronous send Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:31   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 03/10] firmware: add RPMI TEE bus support Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:29   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 04/10] dt-bindings: firmware: add RISC-V RPMI TEE transport Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:16 ` [PATCH RFC 05/10] firmware: add RPMI TEE transport core Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:16 ` [PATCH RFC 06/10] firmware: riscv: rpmi-tee: parse system information tables Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:26   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 07/10] firmware: riscv: rpmi-tee: discover TEE services Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:26   ` sashiko-bot
2026-09-29  3:16 ` [PATCH RFC 08/10] firmware: riscv: rpmi-tee: cache TEE capabilities Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi
2026-09-29  3:16   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:17 ` [PATCH RFC 09/10] firmware: riscv: rpmi-tee: add memory parcel operations Amirreza Zarrabi
2026-09-29  3:17   ` Amirreza Zarrabi
2026-09-29  3:17   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:29   ` sashiko-bot
2026-09-29  3:17 ` [PATCH RFC 10/10] firmware: riscv: rpmi-tee: add signal bus support Amirreza Zarrabi
2026-09-29  3:17   ` Amirreza Zarrabi
2026-09-29  3:17   ` Amirreza Zarrabi via OP-TEE
2026-09-29  3:29   ` sashiko-bot

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=20260929033109.27C091F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amirreza.zarrabi@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 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.