|
@@ -21,6 +21,7 @@
|
|
|
/*
|
|
|
* User space memory access functions
|
|
|
*/
|
|
|
+#include <linux/bitops.h>
|
|
|
#include <linux/kasan-checks.h>
|
|
|
#include <linux/string.h>
|
|
|
#include <linux/thread_info.h>
|
|
@@ -102,6 +103,13 @@ static inline void set_fs(mm_segment_t fs)
|
|
|
flag; \
|
|
|
})
|
|
|
|
|
|
+/*
|
|
|
+ * When dealing with data aborts or instruction traps we may end up with
|
|
|
+ * a tagged userland pointer. Clear the tag to get a sane pointer to pass
|
|
|
+ * on to access_ok(), for instance.
|
|
|
+ */
|
|
|
+#define untagged_addr(addr) sign_extend64(addr, 55)
|
|
|
+
|
|
|
#define access_ok(type, addr, size) __range_ok(addr, size)
|
|
|
#define user_addr_max get_fs
|
|
|
|