diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2023-09-21 08:56:56 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-09-26 00:35:14 +0300 |
commit | 45a832f989e520095429589d5b01b0c65da9b574 (patch) | |
tree | 8b322227b0633b1848050c0bba1381106d9140df /drivers | |
parent | 0676bfebf5766f0a60549f74ba597115028fa39c (diff) | |
download | linux-45a832f989e520095429589d5b01b0c65da9b574.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i3c/master/mipi-i3c-hci/dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c index a1ecdfc35641..9897145895c6 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -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; |