Staging
v0.5.1
swh:1:snp:a902887e4be9191b7c6c4406aa06b31c1ce2c7cc
Raw File
Tip revision: ac9a78681b921877518763ba0e89202254349d1b authored by Linus Torvalds on 07 May 2023, 20:34:35 UTC
Linux 6.4-rc1
Tip revision: ac9a786
maccess.c
// SPDX-License-Identifier: GPL-2.0-only

#include <linux/uaccess.h>
#include <linux/kernel.h>

bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
{
	/* highest bit set means kernel space */
	return (unsigned long)unsafe_src >> (BITS_PER_LONG - 1);
}
back to top