The patch below does not apply to the 3.3-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From fefe1ed1398b81e3fadc92d11d91162d343c8836 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Sun, 13 May 2012 20:09:38 +0300
Subject: [PATCH] iommu: Fix off by one in dmar_get_fault_reason()

fault_reason - 0x20 == ARRAY_SIZE(irq_remap_fault_reasons) is
one past the end of the array.

Signed-off-by: Dan Carpenter <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Youquan Song <[email protected]>
Cc: walter harms <[email protected]>
Cc: Suresh Siddha <[email protected]>
Cc: <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 5ef65cf..3a74e44 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -1057,8 +1057,8 @@ static const char *irq_remap_fault_reasons[] =
 
 const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type)
 {
-       if (fault_reason >= 0x20 && (fault_reason <= 0x20 +
-                                    ARRAY_SIZE(irq_remap_fault_reasons))) {
+       if (fault_reason >= 0x20 && (fault_reason - 0x20 <
+                                       ARRAY_SIZE(irq_remap_fault_reasons))) {
                *fault_type = INTR_REMAP;
                return irq_remap_fault_reasons[fault_reason - 0x20];
        } else if (fault_reason < ARRAY_SIZE(dma_remap_fault_reasons)) {

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to