From: sashiko-bot@kernel.org
To: pankaj.gupta@oss.nxp.com
Cc: devicetree@vger.kernel.org, Frank.Li@kernel.org,
conor+dt@kernel.org, robh@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v33 4/7] firmware: imx: device context dedicated to priv
Date: Wed, 05 Aug 2026 08:16:07 +0000 [thread overview]
Message-ID: <20260805081608.F38D71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260805-imx-se-if-v33-4-212e32ff0295@nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] DMA buffer UAF when `ele_msg_send_rcv()` times out in `ele_get_info()`.
--
--- Patch [4]: [PATCH v33 4/7] firmware: imx: device context dedicated to priv ---
commit 27c9de28d615ebae1d88d019d8d364c4ca4999e1
Author: Pankaj Gupta <pankaj.gupta@nxp.com>
firmware: imx: device context dedicated to priv
Add priv_dev_ctx to prepare enabling misc-device context based send-receive
path, to communicate with FW.
No functionality change.
> diff --git a/drivers/firmware/imx/ele_base_msg.c b/drivers/firmware/imx/ele_base_msg.c
> index 724f6e913ce79..b70e3ef88a168 100644
> --- a/drivers/firmware/imx/ele_base_msg.c
> +++ b/drivers/firmware/imx/ele_base_msg.c
> @@ -71,8 +71,9 @@ int ele_get_info(struct se_if_priv *priv, struct ele_dev_info *s_info)
> tx_msg->data[0] = upper_32_bits(get_info_addr);
> tx_msg->data[1] = lower_32_bits(get_info_addr);
> tx_msg->data[2] = sizeof(*s_info);
> - ret = ele_msg_send_rcv(priv, tx_msg, ELE_GET_INFO_REQ_MSG_SZ, rx_msg,
> - ELE_GET_INFO_RSP_MSG_SZ);
> +
> + ret = ele_msg_send_rcv(priv->priv_dev_ctx, tx_msg, ELE_GET_INFO_REQ_MSG_SZ,
> + rx_msg, ELE_GET_INFO_RSP_MSG_SZ);
> if (ret < 0) {
> ele_get_info_cleanup(priv, get_info_data, get_info_addr, get_info_len);
> return ret;
[Severity: Critical]
Does this code risk a DMA use-after-free if the firmware command times out?
If ele_msg_send_rcv() times out and returns -ETIMEDOUT, the error path
calls ele_get_info_cleanup(), which frees the DMA buffer back to the system.
Since the firmware command was not aborted, if the firmware is delayed and
responds later, it may complete the operation and perform a DMA write of the
device info directly into the now-freed memory. This could cause silent memory
corruption of whichever subsystem reallocated the physical page.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805-imx-se-if-v33-0-212e32ff0295@nxp.com?part=4
next prev parent reply other threads:[~2026-08-05 8:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 8:44 [PATCH v33 0/7] firmware: imx: driver for NXP secure-enclave pankaj.gupta
2026-08-05 8:44 ` [PATCH v33 1/7] Documentation/firmware: add imx/se to other_interfaces pankaj.gupta
2026-08-05 7:58 ` sashiko-bot
2026-08-05 8:44 ` [PATCH v33 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc pankaj.gupta
2026-08-05 8:44 ` [PATCH v33 3/7] firmware: imx: add driver for NXP EdgeLock Enclave pankaj.gupta
2026-08-05 8:09 ` sashiko-bot
2026-08-05 13:08 ` Pankaj Gupta (OSS)
2026-08-05 8:44 ` [PATCH v33 4/7] firmware: imx: device context dedicated to priv pankaj.gupta
2026-08-05 8:16 ` sashiko-bot [this message]
2026-08-05 13:09 ` Pankaj Gupta (OSS)
2026-08-05 8:44 ` [PATCH v33 5/7] firmware: imx: adds miscdev pankaj.gupta
2026-08-05 8:10 ` sashiko-bot
2026-08-05 13:12 ` Pankaj Gupta (OSS)
2026-08-05 8:44 ` [PATCH v33 6/7] arm64: dts: imx8ulp: add secure enclave node pankaj.gupta
2026-08-05 8:02 ` sashiko-bot
2026-08-05 8:44 ` [PATCH v33 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=20260805081608.F38D71F000E9@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