aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2008-02-20 13:33:38 -0600
committerIngo Molnar <mingo@elte.hu>2008-04-17 20:05:39 +0200
commitb4b8ac524d9b6ed7229017145afa1d7afbea4a48 (patch)
treec1b8ef7b22ebc956c0effd0ad6b5a37290f86bda /mm
parent64e9ee3095b61d0300ea548216a57d2536611309 (diff)
kgdb: fix optional arch functions and probe_kernel_*
Fix two regressions dealing with the kgdb core. 1) kgdb_skipexception and kgdb_post_primary_code are optional functions that are only required on archs that need special exception fixups. 2) The kernel address space scope must be set on any probe_kernel_* function or archs such as ARCH=arm will not allow access to the kernel memory space. As an example, it is required to allow the full kernel address space is when you the kernel debugger to inspect a system call. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm')
-rw-r--r--mm/maccess.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/maccess.c b/mm/maccess.c
index 24f81b97140..ac40796cfb1 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -17,11 +17,14 @@
long probe_kernel_read(void *dst, void *src, size_t size)
{
long ret;
+ mm_segment_t old_fs = get_fs();
+ set_fs(KERNEL_DS);
pagefault_disable();
ret = __copy_from_user_inatomic(dst,
(__force const void __user *)src, size);
pagefault_enable();
+ set_fs(old_fs);
return ret ? -EFAULT : 0;
}
@@ -39,10 +42,13 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
long probe_kernel_write(void *dst, void *src, size_t size)
{
long ret;
+ mm_segment_t old_fs = get_fs();
+ set_fs(KERNEL_DS);
pagefault_disable();
ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
pagefault_enable();
+ set_fs(old_fs);
return ret ? -EFAULT : 0;
}