Commit e1b1c7f9 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Andrew Morton

s390/checksum: add a KMSAN check

Add a KMSAN check to the CKSM inline assembly, similar to how it was done
for ASAN in commit e42ac778 ("s390/checksum: always use cksm
instruction").

Link: https://lkml.kernel.org/r/20240621113706.315500-26-iii@linux.ibm.comSigned-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Acked-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: <kasan-dev@googlegroups.com>
Cc: Marco Elver <elver@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 008dead4
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define _S390_CHECKSUM_H #define _S390_CHECKSUM_H
#include <linux/instrumented.h> #include <linux/instrumented.h>
#include <linux/kmsan-checks.h>
#include <linux/in6.h> #include <linux/in6.h>
static inline __wsum cksm(const void *buff, int len, __wsum sum) static inline __wsum cksm(const void *buff, int len, __wsum sum)
...@@ -23,6 +24,7 @@ static inline __wsum cksm(const void *buff, int len, __wsum sum) ...@@ -23,6 +24,7 @@ static inline __wsum cksm(const void *buff, int len, __wsum sum)
}; };
instrument_read(buff, len); instrument_read(buff, len);
kmsan_check_memory(buff, len);
asm volatile("\n" asm volatile("\n"
"0: cksm %[sum],%[rp]\n" "0: cksm %[sum],%[rp]\n"
" jo 0b\n" " jo 0b\n"
......
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