diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2022-11-30 12:40:34 +0300 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2022-12-02 20:25:04 +0300 |
commit | dfe843dce775f16e3d15a1bf14e5363bff2321f3 (patch) | |
tree | e9c5f13696357f8cbdf88685019e2e9b49743380 /arch/s390/include/asm/checksum.h | |
parent | 78c045c08a393285e615260c50cedf9cea5a7fa1 (diff) | |
download | linux-dfe843dce775f16e3d15a1bf14e5363bff2321f3.tar.xz |
s390/checksum: support GENERIC_CSUM, enable it for KASAN
This is the s390 variant of commit d911c67e10b4 ("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: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/checksum.h')
-rw-r--r-- | arch/s390/include/asm/checksum.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/include/asm/checksum.h b/arch/s390/include/asm/checksum.h index cdd19d326345..d977a3a2f619 100644 --- a/arch/s390/include/asm/checksum.h +++ b/arch/s390/include/asm/checksum.h @@ -12,6 +12,12 @@ #ifndef _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/in6.h> @@ -129,4 +135,5 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, return csum_fold((__force __wsum)(sum >> 32)); } +#endif /* CONFIG_GENERIC_CSUM */ #endif /* _S390_CHECKSUM_H */ |