* [PATCH] Bluetooth: btmrvl_sdio: Bound fw dump count by memory table size
@ 2026-11-25 12:13 Maoyi Xie
2026-11-25 21:11 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Maoyi Xie @ 2026-11-25 12:13 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz; +Cc: linux-bluetooth
btmrvl_sdio_coredump() runs when root writes the coredump attribute. It
reads the number of memory regions, dump_num, from a card register. Two
loops then walk mem_type_mapping_tbl[] up to dump_num, but the table has
15 entries.
If the card reports more than 15, the first loop can store a vzalloc()
pointer and a size past the table. The second loop copies from the
pointer it finds there, then frees it.
Limit dump_num to the size of the table, as commit dbca9dfd3bfc
("wifi: mwifiex: bound SDIO fw dump count by memory table size") did in
mwifiex.
Found with a CodeQL-based static analysis tool that we are developing.
Reproduced in a userspace harness under AddressSanitizer. Not tested on
hardware.
Fixes: dc759613b024 ("Bluetooth: btmrvl add firmware dump support")
Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
---
I used an LLM to help write the harness and this patch.
drivers/bluetooth/btmrvl_sdio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 4fd241693a10..cbf63e737ff0 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -1378,6 +1378,10 @@ static void btmrvl_sdio_coredump(struct device *dev)
goto done;
}
+ /* Limit the dump count to the memory table size */
+ if (dump_num > ARRAY_SIZE(mem_type_mapping_tbl))
+ dump_num = ARRAY_SIZE(mem_type_mapping_tbl);
+
/* Read the length of every memory which will dump */
for (idx = 0; idx < dump_num; idx++) {
struct memory_type_mapping *entry = &mem_type_mapping_tbl[idx];
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: Bluetooth: btmrvl_sdio: Bound fw dump count by memory table size
2026-11-25 12:13 [PATCH] Bluetooth: btmrvl_sdio: Bound fw dump count by memory table size Maoyi Xie
@ 2026-11-25 21:11 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-25 21:11 UTC (permalink / raw)
To: linux-bluetooth, maoyixie.tju
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1222074/
---Test result---
Test Summary:
CheckPatch PASS 0.51 seconds
VerifyFixes PASS 0.10 seconds
VerifySignedoff PASS 0.09 seconds
GitLint PASS 0.27 seconds
SubjectPrefix PASS 0.09 seconds
BuildKernel PASS 17.68 seconds
CheckAllWarning PASS 20.91 seconds
CheckSparse PASS 22.20 seconds
BuildKernel32 PASS 19.48 seconds
CheckKernelLLVM PASS 20.02 seconds
TestRunnerSetup PASS 430.45 seconds
IncrementalBuild PASS 17.84 seconds
https://github.com/bluez/bluetooth-next/pull/1224
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-25 21:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 12:13 [PATCH] Bluetooth: btmrvl_sdio: Bound fw dump count by memory table size Maoyi Xie
2026-11-25 21:11 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox