aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-04-17 14:05:36 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 14:05:36 -0400
commitc33fa9f5609e918824446ef9a75319d4a802f1f4 (patch)
treeab711865ba14d4e3d21c2e480e8b113fc73e08a2 /include/linux
parent4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff)
uaccess: add probe_kernel_write()
add probe_kernel_read() and probe_kernel_write(). Uninlined and restricted to kernel range memory only, as suggested by Linus. Signed-off-by: Ingo Molnar <mingo@elte.hu> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/uaccess.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 975c963e5789..fec6decfb983 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -84,4 +84,26 @@ static inline unsigned long __copy_from_user_nocache(void *to,
84 ret; \ 84 ret; \
85 }) 85 })
86 86
87/*
88 * probe_kernel_read(): safely attempt to read from a location
89 * @dst: pointer to the buffer that shall take the data
90 * @src: address to read from
91 * @size: size of the data chunk
92 *
93 * Safely read from address @src to the buffer at @dst. If a kernel fault
94 * happens, handle that and return -EFAULT.
95 */
96extern long probe_kernel_read(void *dst, void *src, size_t size);
97
98/*
99 * probe_kernel_write(): safely attempt to write to a location
100 * @dst: address to write to
101 * @src: pointer to the data that shall be written
102 * @size: size of the data chunk
103 *
104 * Safely write to address @dst from the buffer at @src. If a kernel fault
105 * happens, handle that and return -EFAULT.
106 */
107extern long probe_kernel_write(void *dst, void *src, size_t size);
108
87#endif /* __LINUX_UACCESS_H__ */ 109#endif /* __LINUX_UACCESS_H__ */