summaryrefslogtreecommitdiffstats
path: root/include/linux/uaccess.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2019-04-03 09:39:48 +0200
committerIngo Molnar <mingo@kernel.org>2019-04-03 11:02:19 +0200
commite74deb11931ff682b59d5b9d387f7115f689698e (patch)
tree6d9698ce16b48c95ecff5ca40f8b2701941b9583 /include/linux/uaccess.h
parent88e4718275c1bddca6f61f300688b4553dc8584b (diff)
downloadlinux-e74deb11931ff682b59d5b9d387f7115f689698e.tar.gz
linux-e74deb11931ff682b59d5b9d387f7115f689698e.tar.bz2
linux-e74deb11931ff682b59d5b9d387f7115f689698e.zip
x86/uaccess: Introduce user_access_{save,restore}()
Introduce common helpers for when we need to safely suspend a uaccess section; for instance to generate a {KA,UB}SAN report. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/uaccess.h')
-rw-r--r--include/linux/uaccess.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 37b226e8df13..2b70130af585 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -268,6 +268,8 @@ extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
#define user_access_end() do { } while (0)
#define unsafe_get_user(x, ptr, err) do { if (unlikely(__get_user(x, ptr))) goto err; } while (0)
#define unsafe_put_user(x, ptr, err) do { if (unlikely(__put_user(x, ptr))) goto err; } while (0)
+static inline unsigned long user_access_save(void) { return 0UL; }
+static inline void user_access_restore(unsigned long flags) { }
#endif
#ifdef CONFIG_HARDENED_USERCOPY