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-next>] [day] [month] [year] [list]
Message-ID:  <loom.20090220T223617-127@post.gmane.org>
Date:	Fri, 20 Feb 2009 22:39:13 +0000 (UTC)
From:	Dheeraj Reddy <dheerajr@...il.com>
To:	linux-kernel@...r.kernel.org
Subject:  Incorrect #ifdef in arch/x86/mm/pat.c 

Hello there,
    The checks for reading /dev/kmem and /dev/mem in arch/x86/mm/pat.c seems to 
be incorrect when CONFIG_STRICT_DEVMEM is set.
Following patch corrects it.
The check should always return 1 when CONFIG_STRICT_DEVMEM is not defined, 
similar to what is in drivers/char/mem.c

truly
dheeraj

[dreddy-desktop:~/Ksources/git.linux-2.6]$ git diff
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index aebbf67..2aff276 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -503,12 +503,6 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned 
l
 }

 #ifdef CONFIG_STRICT_DEVMEM
-/* This check is done in drivers/char/mem.c in case of STRICT_DEVMEM*/
-static inline int range_is_allowed(unsigned long pfn, unsigned long size)
-{
-       return 1;
-}
-#else
 /* This check is needed to avoid cache aliasing when PAT is enabled */
 static inline int range_is_allowed(unsigned long pfn, unsigned long size)
 {
@@ -531,6 +525,12 @@ static inline int range_is_allowed(unsigned long pfn, 
unsig
        }
        return 1;
 }
+#else
+/* This check is done in drivers/char/mem.c in case of STRICT_DEVMEM*/
+static inline int range_is_allowed(unsigned long pfn, unsigned long size)
+{
+       return 1;
+}
 #endif /* CONFIG_STRICT_DEVMEM */

 int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,



--
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