1 // SPDX-License-Identifier: GPL-2.0-only
6 #include <linux/uaccess.h>
7 #include <linux/kernel.h>
10 bool copy_from_kernel_nofault_allowed(const void *src, size_t size)
12 void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE);
14 if ((unsigned long)src < PAGE_SIZE || size <= 0)
16 if (os_mincore(psrc, size + src - psrc) <= 0)