x86-kmsan-handle-open-coded-assembly-in-lib-iomemc.patch removed from -mm tree
The quilt patch titled
Subject: x86: kmsan: handle open-coded assembly in lib/iomem.c
has been removed from the -mm tree. Its filename was
x86-kmsan-handle-open-coded-assembly-in-lib-iomemc.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: handle open-coded assembly in lib/iomem.c
Date: Thu, 15 Sep 2022 17:04:08 +0200
KMSAN cannot intercept memory accesses within asm() statements. That's why we add kmsan_unpoison_memory() and kmsan_check_memory() to hint it how to handle memory copied from/to I/O memory.
---
arch/x86/lib/iomem.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/x86/lib/iomem.c renamed from arch/x86/lib/iomem.c~x86-kmsan-handle-open-coded-assembly-in-lib-iomemc +5 -0
@@ -1,6 +1,7 @@#include <linux/string.h> #include <linux/module.h> #include <linux/io.h> +#include <linux/kmsan-checks.h> #define movs (type,to,from) \ asm volatile("movs" type:"=&D" (to), "=&S" (from):"0" (to), "1" (from):"memory")
@@ -37,6 +38,8 @@ static void string_memcpy_fromio(void *t n-=2 ; }rep_movs (to, (const void *)from, n); +/* KMSAN must treat values read from devices as initialized. */ +kmsan_unpoison_memory (to, n); }static void string_memcpy_toio (volatile void __iomem *to,const void *from,size_t n)
@@ -44,6 +47,8 @@ static void string_memcpy_toio(volatileif (unlikely (!n))return ; +/* Make sure uninitialized memory isn't copied to devices. */ +kmsan_check_memory (from, n);/* Align any unaligned destination IO */ if (unlikely (1 & (unsigned long )to)) {movs ("b" , to, from);
_
Patches currently in -mm which might be from [email protected] are