* [PATCH] media: dw2102: Fix a buffer overflow
@ 2026-07-05 12:41 Maksim Pinigin
0 siblings, 0 replies; only message in thread
From: Maksim Pinigin @ 2026-07-05 12:41 UTC (permalink / raw)
To: linux-media
This bug in dw2102_load_firmware() function appears only when building
the kernel via LLVM+Clang. Due to reading of 64 bytes chunk, it may
happen that there will be an attempt to read a more bytes in chunk than
there is left, which is why Kernel oops occurs.
At least this bug happens when downloading the firmware for Prof
Revolution DVB-S2 7500 USB.
Signed-off-by: Maksim Pinigin <pinigin@mapicom.org>
---
drivers/media/usb/dvb-usb/dw2102.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb/dw2102.c
b/drivers/media/usb/dvb-usb/dw2102.c
index 4fecf2f965e9..ad90d7be4412 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -1893,7 +1893,7 @@ static int dw2102_load_firmware(struct usb_device
*dev,
break;
}
info("start downloading DW210X firmware");
- p = kmalloc(fw->size, GFP_KERNEL);
+ p = kzalloc(round_up(fw->size, 0x40), GFP_KERNEL);
reset = 1;
/*stop the CPU*/
dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1, DW210X_WRITE_MSG);
--
2.39.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-05 12:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-05 12:41 [PATCH] media: dw2102: Fix a buffer overflow Maksim Pinigin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox