aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/kgdb.c11
-rw-r--r--mm/maccess.c6
2 files changed, 17 insertions, 0 deletions
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 68aea78407e4..31425e0fbf20 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -200,6 +200,17 @@ int __weak kgdb_arch_init(void)
200 return 0; 200 return 0;
201} 201}
202 202
203int __weak kgdb_skipexception(int exception, struct pt_regs *regs)
204{
205 return 0;
206}
207
208void __weak
209kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
210{
211 return;
212}
213
203/** 214/**
204 * kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb. 215 * kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb.
205 * @regs: Current &struct pt_regs. 216 * @regs: Current &struct pt_regs.
diff --git a/mm/maccess.c b/mm/maccess.c
index 24f81b971403..ac40796cfb15 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -17,11 +17,14 @@
17long probe_kernel_read(void *dst, void *src, size_t size) 17long probe_kernel_read(void *dst, void *src, size_t size)
18{ 18{
19 long ret; 19 long ret;
20 mm_segment_t old_fs = get_fs();
20 21
22 set_fs(KERNEL_DS);
21 pagefault_disable(); 23 pagefault_disable();
22 ret = __copy_from_user_inatomic(dst, 24 ret = __copy_from_user_inatomic(dst,
23 (__force const void __user *)src, size); 25 (__force const void __user *)src, size);
24 pagefault_enable(); 26 pagefault_enable();
27 set_fs(old_fs);
25 28
26 return ret ? -EFAULT : 0; 29 return ret ? -EFAULT : 0;
27} 30}
@@ -39,10 +42,13 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
39long probe_kernel_write(void *dst, void *src, size_t size) 42long probe_kernel_write(void *dst, void *src, size_t size)
40{ 43{
41 long ret; 44 long ret;
45 mm_segment_t old_fs = get_fs();
42 46
47 set_fs(KERNEL_DS);
43 pagefault_disable(); 48 pagefault_disable();
44 ret = __copy_to_user_inatomic((__force void __user *)dst, src, size); 49 ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
45 pagefault_enable(); 50 pagefault_enable();
51 set_fs(old_fs);
46 52
47 return ret ? -EFAULT : 0; 53 return ret ? -EFAULT : 0;
48} 54}