Lines Matching +full:fault +full:- +full:inject
1 // SPDX-License-Identifier: GPL-2.0
4 #include <linux/fault-inject-usercopy.h>
5 #include <linux/kasan-checks.h>
13 #include <asm/word-at-a-time.h>
19 (((long) dst | (long) src) & (sizeof(long) - 1))
24 * 'count' is the user-supplied count (return 'count' if we
26 * -EFAULT if we hit it).
40 /* Fall back to byte-at-a-time if we get a page fault */ in do_strncpy_from_user()
50 * as an opaque set of bytes. Without the post-NUL mask, any BPF in do_strncpy_from_user()
65 max -= sizeof(unsigned long); in do_strncpy_from_user()
77 max--; in do_strncpy_from_user()
81 * Uhhuh. We hit 'max'. But was that the user-specified maximum in do_strncpy_from_user()
82 * too? If so, that's ok - we got as much as the user asked for. in do_strncpy_from_user()
92 return -EFAULT; in do_strncpy_from_user()
96 * strncpy_from_user: - Copy a NUL terminated string from userspace.
102 * Copies a NUL-terminated string from userspace to kernel space.
107 * If access to userspace fails, returns -EFAULT (some data may have been
119 return -EFAULT; in strncpy_from_user()
135 unsigned long max = max_addr - src_addr; in strncpy_from_user()
139 * Truncate 'max' to the user-specified limit, so that in strncpy_from_user()
153 return -EFAULT; in strncpy_from_user()