1 #include <linux/uaccess.h>
3 /* out-of-line parts */
5 #ifndef INLINE_COPY_FROM_USER
6 unsigned long _copy_from_user(void *to, const void __user *from, unsigned long n)
10 if (likely(access_ok(VERIFY_READ, from, n))) {
11 kasan_check_write(to, n);
12 res = raw_copy_from_user(to, from, n);
15 memset(to + (n - res), 0, res);
18 EXPORT_SYMBOL(_copy_from_user);
21 #ifndef INLINE_COPY_TO_USER
22 unsigned long _copy_to_user(void *to, const void __user *from, unsigned long n)
25 if (likely(access_ok(VERIFY_WRITE, to, n))) {
26 kasan_check_read(from, n);
27 n = raw_copy_to_user(to, from, n);
31 EXPORT_SYMBOL(_copy_to_user);