From: Frank Li <Frank.li@oss.nxp.com>
To: "Pankaj Gupta (OSS)" <pankaj.gupta@oss.nxp.com>
Cc: "sashiko-reviews@lists.linux.dev"
<sashiko-reviews@lists.linux.dev>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"Frank.Li@kernel.org" <Frank.Li@kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"robh@kernel.org" <robh@kernel.org>
Subject: Re: [PATCH v36 3/7] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Tue, 18 Aug 2026 15:17:50 -0500 [thread overview]
Message-ID: <aoS97oGetJSFW54a@SMW015318> (raw)
In-Reply-To: <GV2PR04MB12271D7E7AAD64AE668A673CC95A62@GV2PR04MB12271.eurprd04.prod.outlook.com>
On Tue, Aug 18, 2026 at 08:45:26AM +0000, Pankaj Gupta (OSS) wrote:
> > > > +void se_if_rx_callback(struct mbox_client *mbox_cl, void *msg) {
> > > [ ... ]
> > > > + } else if (header->tag == priv->if_defs->rsp_tag) {
> > > [ ... ]
> > > > + se_clbk_hdl->rx_msg_sz = min(rx_msg_sz, exp_rx_msg_sz);
> > > > + memcpy(se_clbk_hdl->rx_msg, msg, se_clbk_hdl->rx_msg_sz);
> > >
> > > [Severity: High]
> > > If the mailbox controller driver passes a pointer to a small local
> > > buffer on the IRQ stack for msg, but the untrusted firmware-provided
> > > header->size specifies a large size, does this memcpy() read
> > > out-of-bounds past the msg pointer capacity?
> >
> > Please check this also
> >
> > Frank
> >
>
> Not an issue.
> rx_msg_sz is derived from the firmware-provided header->size field.
> It is safe to use as the source length for the memcpy() calls below
> because the MU mailbox driver (imx-mailbox.c) already validates that
> header->size does not exceed the capacity of its own fixed-size
> priv->msg buffer (sizeof(imx_sc_rpc_msg_max) = 124 bytes for
> i.MX8/i.MX93, sizeof(imx_s4_rpc_msg_max) = 1020 bytes for S4
> variants). If firmware reports an oversized length the mailbox driver
> returns -EINVAL and never invokes this callback, so rx_msg_sz here is
> always <= the capacity of the msg pointer. The min() / min_t() calls
> below additionally clamp the copy to the destination buffer size.
>
> >
> > > --
> > > Sashiko AI review *
> > > https://sashiko.dev/#/patchset/20260817-imx-se-if-v36-0-
> > 45c42847bfd8@o
> > > ss.nxp.com?part=3
>
> NXP Confidential
Maybe it is auto added. In public email, can't use tag "NXP Confidential"
Frank
next prev parent reply other threads:[~2026-08-18 20:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 14:05 [PATCH v36 0/7] firmware: imx: driver for NXP secure-enclave Pankaj Gupta via B4 Relay
2026-08-17 14:05 ` [PATCH v36 1/7] Documentation/firmware: add imx/se to other_interfaces Pankaj Gupta via B4 Relay
2026-08-17 8:39 ` sashiko-bot
2026-08-17 14:06 ` [PATCH v36 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc Pankaj Gupta via B4 Relay
2026-08-17 14:06 ` [PATCH v36 3/7] firmware: imx: add driver for NXP EdgeLock Enclave Pankaj Gupta via B4 Relay
2026-08-17 8:48 ` sashiko-bot
2026-08-17 18:40 ` Frank Li
2026-08-18 8:45 ` Pankaj Gupta (OSS)
2026-08-18 20:17 ` Frank Li [this message]
2026-08-17 14:06 ` [PATCH v36 4/7] firmware: imx: device context dedicated to priv Pankaj Gupta via B4 Relay
2026-08-17 14:06 ` [PATCH v36 5/7] firmware: imx: adds miscdev Pankaj Gupta via B4 Relay
2026-08-17 8:49 ` sashiko-bot
2026-08-17 18:03 ` Pankaj Gupta (OSS)
2026-08-17 18:37 ` Frank Li
2026-08-18 9:04 ` Pankaj Gupta (OSS)
2026-08-18 18:21 ` Frank Li
2026-08-17 14:06 ` [PATCH v36 6/7] arm64: dts: imx8ulp: add secure enclave node Pankaj Gupta via B4 Relay
2026-08-17 8:43 ` sashiko-bot
2026-08-17 14:06 ` [PATCH v36 7/7] arm64: dts: imx8ulp: add reserved memory for EdgeLock Enclave Pankaj Gupta via B4 Relay
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=aoS97oGetJSFW54a@SMW015318 \
--to=frank.li@oss.nxp.com \
--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