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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Jun 2011 02:53:35 -0400
From:	Chuck Ebbert <cebbert@...hat.com>
To:	linux-mm@...ck.org
Cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] mm: fix unmap_atomic range checks

Commit 3e4d3af501cccdc8a8cca41bdbe57d54ad7e7e73 ("mm: stack based
kmap_atomic()", in 2.6.37-rc1) had three places where range checking
logic was reversed.

Signed-off-by: Chuck Ebbert <cebbert@...hat.com>

--- a/arch/tile/mm/highmem.c
+++ b/arch/tile/mm/highmem.c
@@ -235,8 +235,8 @@ void __kunmap_atomic(void *kvaddr)
 {
 	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 
-	if (vaddr >= __fix_to_virt(FIX_KMAP_END) &&
-	    vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) {
+	if (vaddr >= __fix_to_virt(FIX_KMAP_BEGIN) &&
+	    vaddr <= __fix_to_virt(FIX_KMAP_END)) {
 		pte_t *pte = kmap_get_pte(vaddr);
 		pte_t pteval = *pte;
 		int idx, type;
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -70,8 +70,8 @@ void __kunmap_atomic(void *kvaddr)
 {
 	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 
-	if (vaddr >= __fix_to_virt(FIX_KMAP_END) &&
-	    vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) {
+	if (vaddr >= __fix_to_virt(FIX_KMAP_BEGIN) &&
+	    vaddr <= __fix_to_virt(FIX_KMAP_END)) {
 		int idx, type;
 
 		type = kmap_atomic_idx();
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -94,8 +94,8 @@ iounmap_atomic(void __iomem *kvaddr)
 {
 	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 
-	if (vaddr >= __fix_to_virt(FIX_KMAP_END) &&
-	    vaddr <= __fix_to_virt(FIX_KMAP_BEGIN)) {
+	if (vaddr >= __fix_to_virt(FIX_KMAP_BEGIN) &&
+	    vaddr <= __fix_to_virt(FIX_KMAP_END)) {
 		int idx, type;
 
 		type = kmap_atomic_idx();
--
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