Re: [PATCH] mailbox: Prevent out-of-bounds access in of_mbox_index_xlate()

From: Joonwon Kang

Date: Wed Mar 04 2026 - 06:01:33 EST


>> [ Upstream commit fcd7f96c783626c07ee3ed75fa3739a8a2052310 ]
>>
>> Although it is guided that `#mbox-cells` must be at least 1, there are
>> many instances of `#mbox-cells = <0>;` in the device tree. If that is
>> the case and the corresponding mailbox controller does not provide
>> `fw_xlate` and of_xlate` function pointers, `of_mbox_index_xlate()` will
>> be used by default and out-of-bounds accesses could occur due to lack of
>> bounds check in that function.
>>
>> Cc: stable@xxxxxxxxxxxxxxx
>> Signed-off-by: Joonwon Kang <joonwonkang@xxxxxxxxxx>
>> Signed-off-by: Jassi Brar <jassisinghbrar@xxxxxxxxx>
>> [ changed sp->nargs to sp->args_count in the code and
>> fw_mbox_index_xlate() to of_mbox_index_xlate() in the commit message. ]
>> Signed-off-by: Joonwon Kang <joonwonkang@xxxxxxxxxx>
>> ---
>> drivers/mailbox/mailbox.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>What kernel tree(s) is this for?

Sorry, please ignore this patch. I have specified the proper kernel tree
in other patches.

Thanks.