All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: marouene.boubakri@oss.nxp.com
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [RFC PATCH v1 5/6] dt-bindings: firmware: add OP-TEE over the RISC-V RPMI TEE service group
Date: Thu, 10 Sep 2026 01:18:01 +0000	[thread overview]
Message-ID: <20260910011802.3EBDE1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260910012057.106966-6-marouene.boubakri@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Local interrupts are disabled for an unbounded duration during OP-TEE calls, breaking preemption and causing lockups.
--

commit c55e76cf03e17b2745cdf1b4ab9a24f5373ec194
Author: Marouene Boubakri <marouene.boubakri@oss.nxp.com>

    dt-bindings: firmware: add OP-TEE over the RISC-V RPMI TEE service group

This commit introduces a new device tree binding for OP-TEE on RISC-V
platforms. It enables OP-TEE to run as a supervisor domain isolated by M-mode
firmware, using the RPMI TEE service group over an SBI MPXY channel.

> diff --git a/Documentation/devicetree/bindings/firmware/linaro,optee-rpmi.yaml b/Documentation/devicetree/bindings/firmware/linaro,optee-rpmi.yaml
> new file mode 100644
> index 0000000000000..1c3dffc331ff9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/firmware/linaro,optee-rpmi.yaml
> @@ -0,0 +1,79 @@

[ ... ]

> +description: |
> +  OP-TEE is a piece of software using hardware features to provide a Trusted
> +  Execution Environment. On RISC-V, OP-TEE runs as a supervisor domain
> +  isolated from the Rich Execution Environment (REE) by the M-mode firmware.
> +
> +  The REE reaches OP-TEE through the TEE service group of the RISC-V Platform
> +  Management Interface (RPMI) [1], carried on a channel of the SBI Message
> +  Proxy (MPXY) extension [2]. Each call into OP-TEE is a TEE_CALL service

[Severity: High]
This binding relies on the SBI MPXY mailbox channel, but does the underlying
implementation cause issues with preemption?

Looking at riscv_sbi_mpxy_mbox_call() in
drivers/mailbox/riscv-sbi-mpxy-mbox.c, local interrupts are disabled for
an unbounded duration during OP-TEE calls:

drivers/mailbox/riscv-sbi-mpxy-mbox.c:riscv_sbi_mpxy_mbox_call() {
	...
	local_irq_save(flags);
	mpxy_mbox_send_rpmi_data(mchan, msg);
	local_irq_restore(flags);
	...
}

Will this cause hard lockups or RCU stalls?

Since mpxy_mbox_send_rpmi_data() issues an unbounded sbi_ecall to OP-TEE
while interrupts are masked, this seems to break OP-TEE's preemption model
(RPC_INTR).

Hardware interrupts cannot be taken by the calling CPU, so OP-TEE cannot
yield correctly to the host OS on foreign interrupts.

Since any OP-TEE invocation (e.g., from unprivileged userspace via the
/dev/tee* nodes) routes through optee_rpmi_invoke_fn() which calls
riscv_sbi_mpxy_mbox_call(), could this create a reliable local
denial-of-service vulnerability?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260910012057.106966-1-marouene.boubakri@oss.nxp.com?part=5

  reply	other threads:[~2026-09-10  1:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10  1:20 [RFC PATCH v1 0/6] tee: optee: RISC-V support over the RPMI TEE service group marouene.boubakri
2026-09-10  1:20 ` marouene.boubakri
2026-09-10  1:20 ` [RFC PATCH v1 1/6] mailbox: riscv-sbi-mpxy: add riscv_sbi_mpxy_mbox_call() for hart-local requests marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri
2026-09-10  1:21   ` sashiko-bot
2026-09-10  1:20 ` [RFC PATCH v1 2/6] tee: optee: select the SMC ABI conduit from the firmware node match data marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri
2026-09-10  1:20 ` [RFC PATCH v1 3/6] tee: optee: teach the memory type check about RISC-V page attributes marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri
2026-09-10  1:19   ` sashiko-bot
2026-09-10  1:20 ` [RFC PATCH v1 4/6] mailbox: riscv-rpmi-message: add TEE service group definitions marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri
2026-09-10  1:12   ` sashiko-bot
2026-09-10  1:20 ` [RFC PATCH v1 5/6] dt-bindings: firmware: add OP-TEE over the RISC-V RPMI TEE service group marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri
2026-09-10  1:18   ` sashiko-bot [this message]
2026-09-10  1:20 ` [RFC PATCH v1 6/6] tee: optee: add a RISC-V conduit over the " marouene.boubakri
2026-09-10  1:20   ` marouene.boubakri

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=20260910011802.3EBDE1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=marouene.boubakri@oss.nxp.com \
    --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.