Skip to content

Commit

Permalink
parisc: let probe_kernel_read() capture access to page zero
Browse files Browse the repository at this point in the history
Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Helge Deller committed Oct 13, 2013
1 parent 2d8b22d commit db080f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion arch/parisc/lib/memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit db080f9

Please sign in to comment.