]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
parisc: let probe_kernel_read() capture access to page zero
authorHelge Deller <deller@gmx.de>
Wed, 9 Oct 2013 21:47:03 +0000 (23:47 +0200)
committerHelge Deller <deller@gmx.de>
Sun, 13 Oct 2013 15:46:31 +0000 (17:46 +0200)
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/lib/memcpy.c

index ac4370b1ca4019f5eaf85f910097bf1cc69c0611..b5507ec06b846f09ed4d38c5841b4eecaffb156e 100644 (file)
@@ -56,7 +56,7 @@
 #ifdef __KERNEL__
 #include <linux/module.h>
 #include <linux/compiler.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #define s_space "%%sr1"
 #define d_space "%%sr2"
 #else
@@ -524,4 +524,17 @@ EXPORT_SYMBOL(copy_to_user);
 EXPORT_SYMBOL(copy_from_user);
 EXPORT_SYMBOL(copy_in_user);
 EXPORT_SYMBOL(memcpy);
+
+long probe_kernel_read(void *dst, const void *src, size_t size)
+{
+       unsigned long addr = (unsigned long)src;
+
+       if (size < 0 || addr < PAGE_SIZE)
+               return -EFAULT;
+
+       /* check for I/O space F_EXTEND(0xfff00000) access as well? */
+
+       return __probe_kernel_read(dst, src, size);
+}
+
 #endif