linux/arch
Andrey Ryabinin 1771c6e1a5 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.

[aryabinin@virtuozzo.com: move kasan check under the condition]
  Link: http://lkml.kernel.org/r/1462869209-21096-1-git-send-email-aryabinin@virtuozzo.com
Link: http://lkml.kernel.org/r/1462538722-1574-4-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20 17:58:30 -07:00
..
alpha PCI changes for the v4.7 merge window: 2016-05-19 13:10:54 -07:00
arc Merge branch 'akpm' (patches from Andrew) 2016-05-19 20:00:06 -07:00
arm Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2016-05-20 10:01:38 -07:00
arm64 Merge branch 'akpm' (patches from Andrew) 2016-05-19 20:00:06 -07:00
avr32 dmaengine updates for 4.7 2016-05-19 11:47:18 -07:00
blackfin Blackfin: comment spelling s/divsor/divisor/ 2016-04-18 12:51:57 +02:00
c6x c6x: Fix misspellings in comments. 2016-04-18 12:45:53 +02:00
cris This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
frv
h8300
hexagon hexagon: Fix misspellings in comments. 2016-04-18 12:45:54 +02:00
ia64 A bunch of cleanups from Matt and some dead code removal from Anna-Maria 2016-05-19 18:14:49 -07:00
m32r
m68k This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
metag metag: mm: use hugetlb_bad_size() 2016-05-19 19:12:14 -07:00
microblaze
mips Merge branch 'akpm' (patches from Andrew) 2016-05-19 20:00:06 -07:00
mn10300
nios2 This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
openrisc openrisc: drop wrongly typed definition of page_to_virt() 2016-04-22 10:08:34 +01:00
parisc parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls 2016-05-06 15:09:07 +02:00
powerpc powerpc updates for 4.7 2016-05-20 10:12:41 -07:00
s390 Merge branch 'akpm' (patches from Andrew) 2016-05-19 20:00:06 -07:00
score
sh This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
sparc arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
tile arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-05-17 16:26:30 -07:00
unicore32
x86 x86/kasan: instrument user memory access API 2016-05-20 17:58:30 -07:00
xtensa This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
.gitignore
Kconfig