x86-kmsan-use-__msan_-string-functions-where-possible.patch removed from -mm tree
The quilt patch titled
Subject: x86: kmsan: use __msan_ string functions where possible.
has been removed from the -mm tree. Its filename was
x86-kmsan-use-__msan_-string-functions-where-possible.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Alexander Potapenko <[email protected]>
Subject: x86: kmsan: use __msan_ string functions where possible.
Date: Thu, 15 Sep 2022 17:04:09 +0200
Unless stated otherwise (by explicitly calling __memcpy(), __memset() or __memmove()) we want all string functions to call their __msan_ versions (e.g. __msan_memcpy() instead of memcpy()), so that shadow and origin values are updated accordingly.
Bootloader must still use the default string functions to avoid crashes.
---
arch/x86/include/asm/string_64.h | 23 +++++++++++++++++++++-- include/linux/fortify-string.h | 2 ++ 2 files changed, 23 insertions(+), 2 deletions(-)
arch/x86/include/asm/string_64.h renamed from arch/x86/include/asm/string_64.h~x86-kmsan-use-__msan_-string-functions-where-possible +21 -2
@@ -11,11 +11,23 @@function. */ #define __HAVE_ARCH_MEMCPY 1 +#if defined(__SANITIZE_MEMORY__) +#undef memcpy +void *__msan_memcpy (void *dst,const void *src,size_t size); +#define memcpy __msan_memcpy +#else extern void *memcpy (void *to,const void *from,size_t len); +#endif extern void *__memcpy (void *to,const void *from,size_t len);#define __HAVE_ARCH_MEMSET +#if defined(__SANITIZE_MEMORY__) +extern void *__msan_memset (void *s,int c,size_t n); +#undef memset +#define memset __msan_memset +#else void *memset (void *s,int c,size_t n); +#endif void *__memset (void *s,int c,size_t n);#define __HAVE_ARCH_MEMSET16
@@ -55,7 +67,13 @@ static inline void *memset64(uint64_t *s }#define __HAVE_ARCH_MEMMOVE +#if defined(__SANITIZE_MEMORY__) +#undef memmove +void *__msan_memmove (void *dest,const void *src,size_t len); +#define memmove __msan_memmove +#else void *memmove (void *dest,const void *src,size_t count); +#endif void *__memmove (void *dest,const void *src,size_t count);int memcmp (const void *cs,const void *ct,size_t count);
@@ -64,8 +82,7 @@ char *strcpy(char *dest, const char *srcchar *strcat (char *dest,const char *src);int strcmp (const char *cs,const char *ct); -#if defined(CONFIG_KASAN ) && !defined(__SANITIZE_ADDRESS__) - +#if (defined(CONFIG_KASAN ) && !defined(__SANITIZE_ADDRESS__))/* * For files that not instrumented (e.g. mm/slub.c) we * should use not instrumented version of mem* functions.
@@ -73,7 +90,9 @@ int strcmp(const char *cs, const char *c#undef memcpy#define memcpy (dst, src, len) __memcpy(dst, src, len) +#undef memmove#define memmove (dst, src, len) __memmove(dst, src, len) +#undef memset#define memset (s, c, n) __memset(s, c, n)#ifndef __NO_FORTIFY
include/linux/fortify-string.h renamed from include/linux/fortify-string.h~x86-kmsan-use-__msan_-string-functions-where-possible +2 -0
@@ -285,8 +285,10 @@ __FORTIFY_INLINE void fortify_memset_chk* __builtin_object_size() must be captured here to avoid evaluating argument * side-effects further into the macro layers. */ +#ifndef CONFIG_KMSAN #define memset (p, c, s) __fortify_memset_chk(p, c, s, \ __builtin_object_size(p, 0), __builtin_object_size(p, 1)) +#endif /* * To make sure the compiler can enforce protection against buffer overflows,
_
Patches currently in -mm which might be from [email protected] are