From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796286500; b=1PfQ7fPyFfXzJhZ3uWViB8QDjueYObV7opCprDnT4U+TtfhajvuMcN5hM248hXMd3L0/ zvCujUwd8tDj+tu+SrPTRRa6DA1r34tYf3XaDSW23ZAk+JSN6REU2iHs+CPwjZUjtIVxn DXXT5/1YTo7KYXl5CeWPDc15h32NncK8GlqnzmsmIZIm5pGg91xVVHjzBjbP9DlrFP1uf 6/BXMTXO5EVqavYsKiXnn7KaEXqi9Cxkshs+VOhiuYEuKSkWIln+awVlqIM/DQVWuzv6+ osbXUMfRWdge4YLTXyrteceaugorHzh9jg4ccQ/Rm4uBoZSHAIn06g/FL8ezHpmRdRw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286500; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=KkmTLauBAjNjI94UkV7xfLqji+m7mZBQXmHztF175kE=; b=WlhLfL065nxnpV1i9JwFW9LJUR/s9zjXe06RLnlH7sB3Twa0c1llzc5HHH+oCFfT/0C1 mTCALER0NQ1wV0OCjlzDlG5G1ZrsdTN55Dd4oTUxxjkhsIP9l1Ar0F4YiAsp72PkP8HGx bIwP5ltnqZEBNZ0jXzhOMvcBwkrh2B931XVsquoi7sq9oF026sQwqC7BmSSVQQBJgeFLy sVUu/FEFVesm3U56Bp9xcpA+RBaXKURzfhHOTS9UxHjMtT2iqFCJRZaGPRJ58DcdejsJC zRs//GnYxcUXdyilO8GRpbXWyUN0d/7PG22Kzw9Ij6HcpoBANHOGwGDPHM4Cq2DsPeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lSWJ2fSB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41B3F606A330; Thu, 3 Dec 2026 08:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lSWJ2fSB Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA0181F000C1; Thu, 3 Dec 2026 08:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796286499; bh=KkmTLauBAjNjI94UkV7xfLqji+m7mZBQXmHztF175kE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lSWJ2fSBKh9DGc06kf69jrUfVvdZFLBCap+FGDc1ZB4M05K73NfYbLGs7W5uO1xNo enG7YAg/12EwUT8HUDZqdKeSOc/+kei+BjM5WV5ABYcBDTAJuabWOAwtFIOiOWMUvd 7syj20+uZR5GZ64e+bCBfrOFIsU/yxwbmotqGzVTiEYf31EDOSfQ5YyhaPSJT+k/zN 1BMa1XuY+4TtU8LOOTmZebEUm/84CJ6pk57Qbl2OGfWdX6zq6LOuSLq0Eir2MpHG6f nUBsk+FcW6/6+gRIpf2xXLeA3e3dqEaL30Xj6/g/Qvr0TFV5K+VD0yDTq5Ac53kUrJ sTO4jkMsUJVaA== From: Lee Jones To: lee@kernel.org Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Beleswar Padhi , Jassi Brar , Nishanth Menon Subject: [PATCH 02/10] mailbox: ti-msgmgr: Use unsigned IDs in ti_msgmgr_of_xlate() Date: Thu, 3 Dec 2026 08:28:02 +0000 Message-ID: X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog In-Reply-To: References: X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Cc: Beleswar Padhi Cc: Jassi Brar Cc: Nishanth Menon 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