lkml.org 
[lkml]   [2009]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH/RFC 1/4] maccess: add weak attribute to probe_kernel_write
From: Heiko Carstens <heiko.carstens@de.ibm.com>

probe_kernel_write() gets used to write to the kernel address space.
E.g. to patch the kernel (kgdb, ftrace, kprobes...). Some architectures
however enable write protection for the kernel text section, so that
writes to this region would fault.
This patch allows to specify an architecture specific version of
probe_kernel_write() which allows to handle and bypass write protection
of the text segment.
That way it is still possible to catch random writes to kernel text
and explicitly allow writes via this interface.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

mm/maccess.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -urpN linux-2.6/mm/maccess.c linux-2.6-patched/mm/maccess.c
--- linux-2.6/mm/maccess.c 2009-03-24 00:12:14.000000000 +0100
+++ linux-2.6-patched/mm/maccess.c 2009-06-02 10:40:04.000000000 +0200
@@ -39,7 +39,7 @@ EXPORT_SYMBOL_GPL(probe_kernel_read);
* Safely write to address @dst from the buffer at @src. If a kernel fault
* happens, handle that and return -EFAULT.
*/
-long probe_kernel_write(void *dst, void *src, size_t size)
+long notrace __weak probe_kernel_write(void *dst, void *src, size_t size)
{
long ret;
mm_segment_t old_fs = get_fs();
--


\
 
 \ /
  Last update: 2009-06-02 13:11    [W:0.058 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site