fs/proc/kcore.c: Add bounce buffer for ktext data
[deliverable/linux.git] / fs / proc / kcore.c
index bd3ac9dca2521237dd83e0c6ea7a154ed5b6f16b..5c89a07e3d7f540b48757b907557e5f5df300ff2 100644 (file)
@@ -509,7 +509,12 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
                        if (kern_addr_valid(start)) {
                                unsigned long n;
 
-                               n = copy_to_user(buffer, (char *)start, tsz);
+                               /*
+                                * Using bounce buffer to bypass the
+                                * hardened user copy kernel text checks.
+                                */
+                               memcpy(buf, (char *) start, tsz);
+                               n = copy_to_user(buffer, buf, tsz);
                                /*
                                 * We cannot distinguish between fault on source
                                 * and fault on destination. When this happens
This page took 0.024294 seconds and 5 git commands to generate.