Skip to content

Commit

Permalink
i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
jhnikula authored and alexandrebelloni committed Sep 25, 2023
1 parent 0676bfe commit 45a832f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i3c/master/mipi-i3c-hci/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
unsigned int i;
bool handled = false;

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

Expand Down

0 comments on commit 45a832f

Please sign in to comment.