commit | 1771c6e1a567ea0ba2cccc0a4ffe68a1419fd8ef | [log] [tgz] |
---|---|---|
author | Andrey Ryabinin <[email protected]> | Fri May 20 16:59:31 2016 -0700 |
committer | Linus Torvalds <[email protected]> | Fri May 20 17:58:30 2016 -0700 |
tree | 5d3110f86fb5068fcffeebae794b49ddb2cd00d6 | |
parent | 64f8ebaf115bcddc4aaa902f981c57ba6506bc42 [diff] |
x86/kasan: instrument user memory access API Exchange between user and kernel memory is coded in assembly language. Which means that such accesses won't be spotted by KASAN as a compiler instruments only C code. Add explicit KASAN checks to user memory access API to ensure that userspace writes to (or reads from) a valid kernel memory. Note: Unlike others strncpy_from_user() is written mostly in C and KASAN sees memory accesses in it. However, it makes sense to add explicit check for all @count bytes that *potentially* could be written to the kernel. [[email protected]: move kasan check under the condition] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrey Ryabinin <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>