Commit dfe843dc authored by Heiko Carstens's avatar Heiko Carstens Committed by Alexander Gordeev

s390/checksum: support GENERIC_CSUM, enable it for KASAN

This is the s390 variant of commit d911c67e ("x86: kasan: kmsan:
support CONFIG_GENERIC_CSUM on x86, enable it for KASAN/KMSAN"). Even
though most of the s390 specific checksum code is written in C there is
still the csum_partial() inline assembly which could prevent KASAN and
KMSAN from seeing all memory accesses.

Therefore switch to GENERIC_CSUM if KASAN is enabled just like x86.
Reviewed-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 78c045c0
...@@ -26,6 +26,10 @@ config GENERIC_BUG ...@@ -26,6 +26,10 @@ config GENERIC_BUG
config GENERIC_BUG_RELATIVE_POINTERS config GENERIC_BUG_RELATIVE_POINTERS
def_bool y def_bool y
config GENERIC_CSUM
bool
default y if KASAN
config GENERIC_LOCKBREAK config GENERIC_LOCKBREAK
def_bool y if PREEMPTION def_bool y if PREEMPTION
......
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
#ifndef _S390_CHECKSUM_H #ifndef _S390_CHECKSUM_H
#define _S390_CHECKSUM_H #define _S390_CHECKSUM_H
#ifdef CONFIG_GENERIC_CSUM
#include <asm-generic/checksum.h>
#else /* CONFIG_GENERIC_CSUM */
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/in6.h> #include <linux/in6.h>
...@@ -129,4 +135,5 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, ...@@ -129,4 +135,5 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
return csum_fold((__force __wsum)(sum >> 32)); return csum_fold((__force __wsum)(sum >> 32));
} }
#endif /* CONFIG_GENERIC_CSUM */
#endif /* _S390_CHECKSUM_H */ #endif /* _S390_CHECKSUM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment