From: sashiko-bot@kernel.org
To: pankaj.gupta@oss.nxp.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev, robh@kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v47 3/7] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Fri, 04 Sep 2026 06:38:59 +0000 [thread overview]
Message-ID: <20260904063859.94A9E1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260904-imx-se-if-v47-3-b474ec6fc52a@nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Discarding successful firmware response and breaking idempotency on deferred signal
--
commit c3c233856b9a36edd6fd79385b30e7951622e780
Author: Pankaj Gupta <pankaj.gupta@nxp.com>
firmware: imx: add driver for NXP EdgeLock Enclave
This commit adds the MU-based communication interface for the NXP EdgeLock
Enclave. It enables messaging between the secure enclave firmware and Linux
for features like HSM, SHE, and V2X on i.MX SoCs.
> diff --git a/drivers/firmware/imx/ele_common.c b/drivers/firmware/imx/ele_common.c
> --- /dev/null
> +++ b/drivers/firmware/imx/ele_common.c
[ ... ]
> +int ele_msg_send_rcv(struct se_if_priv *priv, void *tx_msg, int tx_msg_sz,
> + void *rx_msg, int exp_rx_msg_sz)
> +{
[ ... ]
> + err = ele_msg_rcv(priv, &priv->waiting_rsp_clbk_hdl);
> +
> + if (priv->waiting_rsp_clbk_hdl.signal_rcvd) {
> + /*
> + * Signal was deferred until the FW/kernel protocol resynchronized.
> + * On success report -ERESTARTSYS for the interrupted wait; the
> + * command is not re-sent. Keep real errors like -ETIMEDOUT.
> + */
> + if (err > 0)
> + err = -ERESTARTSYS;
[Severity: High]
If the firmware successfully completes the transaction and ele_msg_rcv
returns a positive response size (err > 0), does returning -ERESTARTSYS
cause the VFS layer to automatically restart the identical syscall?
Since the hardware has already processed the command successfully and mutated
its state, wouldn't restarting the syscall cause the same command to be sent
a second time? This appears to break idempotency and could potentially leak
hardware resources (such as unclosed sessions or orphaned keys) because the
first successful response is discarded and userspace is unaware it succeeded.
> + priv->waiting_rsp_clbk_hdl.signal_rcvd = false;
> + dev_dbg(priv->dev, "Err[0x%x]:Interrupted by signal.\n", err);
> + }
> +
> + ele_msg_send_rcv_cleanup(priv);
> +
> + return err;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-imx-se-if-v47-0-b474ec6fc52a@nxp.com?part=3
next prev parent reply other threads:[~2026-09-04 6:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 11:55 [PATCH v47 0/7] firmware: imx: driver for NXP secure-enclave pankaj.gupta
2026-09-04 11:55 ` [PATCH v47 1/7] Documentation/firmware: add imx/se to other_interfaces pankaj.gupta
2026-09-04 11:56 ` [PATCH v47 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc pankaj.gupta
2026-09-04 6:37 ` sashiko-bot
2026-09-04 11:56 ` [PATCH v47 3/7] firmware: imx: add driver for NXP EdgeLock Enclave pankaj.gupta
2026-09-04 6:38 ` sashiko-bot [this message]
2026-09-04 11:56 ` [PATCH v47 4/7] firmware: imx: device context dedicated to priv pankaj.gupta
2026-09-04 11:56 ` [PATCH v47 5/7] firmware: imx: adds miscdev pankaj.gupta
2026-09-04 6:41 ` sashiko-bot
2026-09-04 8:52 ` Pankaj Gupta (OSS)
2026-09-04 8:56 ` Pankaj Gupta (OSS)
2026-09-04 11:56 ` [PATCH v47 6/7] arm64: dts: imx8ulp: add secure enclave node pankaj.gupta
2026-09-04 11:56 ` [PATCH v47 7/7] arm64: dts: imx8ulp: add reserved memory for EdgeLock Enclave pankaj.gupta
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=20260904063859.94A9E1F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=pankaj.gupta@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox