lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 14 May 2012 06:42:05 -0700
From:	tip-bot for Dan Carpenter <dan.carpenter@...cle.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
	joerg.roedel@....com, youquan.song@...el.com, stable@...nel.org,
	suresh.b.siddha@...el.com, tglx@...utronix.de, wharms@....de,
	dan.carpenter@...cle.com
Subject: [tip:core/iommu] iommu: Fix off by one in dmar_get_fault_reason()

Commit-ID:  fefe1ed1398b81e3fadc92d11d91162d343c8836
Gitweb:     http://git.kernel.org/tip/fefe1ed1398b81e3fadc92d11d91162d343c8836
Author:     Dan Carpenter <dan.carpenter@...cle.com>
AuthorDate: Sun, 13 May 2012 20:09:38 +0300
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Mon, 14 May 2012 14:37:47 +0200

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 <dan.carpenter@...cle.com>
Cc: Joerg Roedel <joerg.roedel@....com>
Cc: Youquan Song <youquan.song@...el.com>
Cc: walter harms <wharms@....de>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: <stable@...nel.org>
Link: http://lkml.kernel.org/r/20120513170938.GA4280@elgon.mountain
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 drivers/iommu/dmar.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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 linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ