]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Disable asm memcpys when kmsan enabled
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 20 Mar 2025 16:38:59 +0000 (12:38 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 24 Mar 2025 13:50:36 +0000 (09:50 -0400)
kmsan doesn't know about inline assembly, obviously; this will close a
ton of syzbot bugs.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/util.h

index d41e133acc4d6b955f494d0ef802d78427a5f785..7d921fc920a05234cb91885ac0bd30b1e7205dbd 100644 (file)
@@ -431,7 +431,7 @@ static inline void memcpy_u64s_small(void *dst, const void *src,
 static inline void __memcpy_u64s(void *dst, const void *src,
                                 unsigned u64s)
 {
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && !defined(CONFIG_KMSAN)
        long d0, d1, d2;
 
        asm volatile("rep ; movsq"
@@ -508,7 +508,7 @@ static inline void __memmove_u64s_up(void *_dst, const void *_src,
        u64 *dst = (u64 *) _dst + u64s - 1;
        u64 *src = (u64 *) _src + u64s - 1;
 
-#ifdef CONFIG_X86_64
+#if defined(CONFIG_X86_64) && !defined(CONFIG_KMSAN)
        long d0, d1, d2;
 
        asm volatile("std ;\n"