Lines Matching refs:n

106 static bool overlaps(const unsigned long ptr, unsigned long n,  in overlaps()  argument
110 unsigned long check_high = check_low + n; in overlaps()
121 unsigned long n, bool to_user) in check_kernel_text_object() argument
127 if (overlaps(ptr, n, textlow, texthigh)) in check_kernel_text_object()
128 usercopy_abort("kernel text", NULL, to_user, ptr - textlow, n); in check_kernel_text_object()
145 if (overlaps(ptr, n, textlow_linear, texthigh_linear)) in check_kernel_text_object()
147 ptr - textlow_linear, n); in check_kernel_text_object()
150 static inline void check_bogus_address(const unsigned long ptr, unsigned long n, in check_bogus_address() argument
154 if (ptr + (n - 1) < ptr) in check_bogus_address()
155 usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n); in check_bogus_address()
159 usercopy_abort("null address", NULL, to_user, ptr, n); in check_bogus_address()
162 static inline void check_heap_object(const void *ptr, unsigned long n, in check_heap_object() argument
171 if (n > PAGE_SIZE - offset) in check_heap_object()
172 usercopy_abort("kmap", NULL, to_user, offset, n); in check_heap_object()
180 usercopy_abort("vmalloc", "no area", to_user, 0, n); in check_heap_object()
182 if (n > area->va_end - addr) { in check_heap_object()
184 usercopy_abort("vmalloc", NULL, to_user, offset, n); in check_heap_object()
196 __check_heap_object(ptr, n, folio_slab(folio), to_user); in check_heap_object()
199 if (n > folio_size(folio) - offset) in check_heap_object()
200 usercopy_abort("page alloc", NULL, to_user, offset, n); in check_heap_object()
213 void __check_object_size(const void *ptr, unsigned long n, bool to_user) in __check_object_size() argument
219 if (!n) in __check_object_size()
223 check_bogus_address((const unsigned long)ptr, n, to_user); in __check_object_size()
226 switch (check_stack_object(ptr, n)) { in __check_object_size()
247 n); in __check_object_size()
251 check_heap_object(ptr, n, to_user); in __check_object_size()
254 check_kernel_text_object((const unsigned long)ptr, n, to_user); in __check_object_size()