s390/kasan: fix strncpy_from_user kasan checks
authorVasily Gorbik <gor@linux.ibm.com>
Tue, 23 Apr 2019 13:36:36 +0000 (15:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 06:18:01 +0000 (08:18 +0200)
commitfcc1ce5b4f42b4de3a8313bd9aacce39c60215d1
tree9301972de2f84f98350f32bdd05409984e8a592f
parenteddfe9672ed2392b8abe782d40abdf1982d8943f
s390/kasan: fix strncpy_from_user kasan checks

[ Upstream commit 01eb42afb45719cb41bb32c278e068073738899d ]

arch/s390/lib/uaccess.c is built without kasan instrumentation. Kasan
checks are performed explicitly in copy_from_user/copy_to_user
functions. But since those functions could be inlined, calls from
files like uaccess.c with instrumentation disabled won't generate
kasan reports. This is currently the case with strncpy_from_user
function which was revealed by newly added kasan test. Avoid inlining of
copy_from_user/copy_to_user when the kernel is built with kasan support
to make sure kasan checks are fully functional.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/include/asm/uaccess.h