1 // SPDX-License-Identifier: GPL-2.0-only 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 3 #include <linux/uaccess.h> 3 #include <linux/uaccess.h> 4 #include <linux/kernel.h> 4 #include <linux/kernel.h> 5 5 6 bool copy_from_kernel_nofault_allowed(const vo 6 bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size) 7 { 7 { 8 /* highest bit set means kernel space 8 /* highest bit set means kernel space */ 9 return (unsigned long)unsafe_src >> (B 9 return (unsigned long)unsafe_src >> (BITS_PER_LONG - 1); 10 } 10 } 11 11
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.