From: Lee Jones <lee@kernel.org>
To: lee@kernel.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Beleswar Padhi <b-padhi@ti.com>,
Jassi Brar <jassisinghbrar@gmail.com>, Nishanth Menon <nm@ti.com>
Subject: [PATCH 02/10] mailbox: ti-msgmgr: Use unsigned IDs in ti_msgmgr_of_xlate()
Date: Thu, 3 Dec 2026 08:28:02 +0000 [thread overview]
Message-ID: <ab24e9ba0e02ca9cee85977de09bfb219f2cecd8.1796286447.git.lee@kernel.org> (raw)
In-Reply-To: <cover.1796286447.git.lee@kernel.org>
ti_msgmgr_of_xlate() stores u32 Device Tree phandle arguments in signed
int variables req_qid and req_pid. On Secure Proxy instances, a
malformed DT argument greater than INT_MAX becomes negative, bypasses
the upper-bound check, and indexes inst->qinsts[req_pid] out of bounds
before the start of the array.
Use u32 for req_qid and req_pid, validate req_pid against
inst->num_valid_queues, and update the error format specifiers to %u.
Fixes: a2b79838b891 ("mailbox: ti-msgmgr: Add support for Secure Proxy")
Closes: https://sashiko.dev/#/bug/linux-bc6deda6-efad-4f90-b213-85bb3fd21eca
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
Cc: Beleswar Padhi <b-padhi@ti.com>
Cc: Jassi Brar <jassisinghbrar@gmail.com>
Cc: Nishanth Menon <nm@ti.com>
drivers/mailbox/ti-msgmgr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
index 2079996092f5..d2d917b53c94 100644
--- a/drivers/mailbox/ti-msgmgr.c
+++ b/drivers/mailbox/ti-msgmgr.c
@@ -596,7 +596,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
const struct of_phandle_args *p)
{
struct ti_msgmgr_inst *inst;
- int req_qid, req_pid;
+ u32 req_qid, req_pid;
struct ti_queue_inst *qinst;
const struct ti_msgmgr_desc *d;
int i, ncells;
@@ -625,7 +625,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
}
if (d->is_sproxy) {
- if (req_pid >= d->num_valid_queues)
+ if (req_pid >= inst->num_valid_queues)
goto err;
qinst = &inst->qinsts[req_pid];
return qinst->chan;
@@ -638,7 +638,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
}
err:
- dev_err(inst->dev, "Queue ID %d, Proxy ID %d is wrong on %pOFn\n",
+ dev_err(inst->dev, "Queue ID %u, Proxy ID %u is wrong on %pOFn\n",
req_qid, req_pid, p->np);
return ERR_PTR(-ENOENT);
}
--
2.56.1.911.g883d8bcb20-goog
next prev parent reply other threads:[~2026-12-03 8:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 8:28 [PATCH 00/10] mailbox: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 8:28 ` [PATCH 01/10] mailbox: qcom-ipcc: Skip of_node_put() on phandle parse failure Lee Jones
2026-12-03 10:38 ` Konrad Dybcio
2026-12-03 8:28 ` Lee Jones [this message]
2026-12-03 8:28 ` [PATCH 03/10] mailbox: riscv-sbi-mpxy: Protect per-CPU shmem access with irqsave Lee Jones
2026-12-03 14:32 ` Rahul Pathak
2026-12-03 8:28 ` [PATCH 04/10] mailbox: riscv-sbi-mpxy: Validate shmem bounds in message send helpers Lee Jones
2026-12-03 8:28 ` [PATCH 05/10] mailbox: bcm-pdc: Unregister mailbox controller before destroying DMA pools Lee Jones
2026-12-03 8:28 ` [PATCH 06/10] mailbox: qcom-ipcc: Remove IRQ domain via devm to avoid ISR use-after-free Lee Jones
2026-12-03 10:39 ` Konrad Dybcio
2026-12-03 8:28 ` [PATCH 07/10] mailbox: sun6i-msgbox: Free IRQ before disabling clock on teardown Lee Jones
2026-12-03 13:43 ` Chen-Yu Tsai
2026-12-03 8:28 ` [PATCH 08/10] mailbox: sun6i-msgbox: Synchronise IRQ during channel shutdown Lee Jones
2026-12-03 13:49 ` Chen-Yu Tsai
2026-12-03 8:28 ` [PATCH 09/10] mailbox: arm_mhu_db: Initialise channel registers before controller registration Lee Jones
2026-12-03 9:40 ` Sudeep Holla
2026-12-03 8:28 ` [PATCH 10/10] mailbox: ti-msgmgr: Return -EIO on queue error in ti_msgmgr_send_data() Lee Jones
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=ab24e9ba0e02ca9cee85977de09bfb219f2cecd8.1796286447.git.lee@kernel.org \
--to=lee@kernel.org \
--cc=b-padhi@ti.com \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nm@ti.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®