Skip to content

Commit 45a832f

Browse files
jhnikulaalexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler
Do not loop over ring headers in hci_dma_irq_handler() that are not allocated and enabled in hci_dma_init(). Otherwise out of bounds access will occur from rings->headers[i] access when i >= number of allocated ring headers. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230921055704.1087277-5-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 0676bfe commit 45a832f

File tree

1 file changed

+1
-1
lines changed
  • drivers/i3c/master/mipi-i3c-hci

1 file changed

+1
-1
lines changed

drivers/i3c/master/mipi-i3c-hci/dma.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
734734
unsigned int i;
735735
bool handled = false;
736736

737-
for (i = 0; mask && i < 8; i++) {
737+
for (i = 0; mask && i < rings->total; i++) {
738738
struct hci_rh_data *rh;
739739
u32 status;
740740

0 commit comments

Comments
 (0)