Thread (56 messages) 56 messages, 6 authors, 2024-06-12
STALE735d
Revisions (7)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]

[PATCH v3 25/34] s390/diag: Unpoison diag224() output buffer

From: Ilya Leoshkevich <iii@linux.ibm.com>
Date: 2023-12-13 23:37:41
Also in: linux-mm, linux-s390, lkml
Subsystem: s390 architecture, the rest · Maintainers: Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Linus Torvalds

Diagnose 224 stores 4k bytes, which cannot be deduced from the inline
assembly constraints. This leads to KMSAN false positives.

Unpoison the output buffer manually with kmsan_unpoison_memory().

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 arch/s390/kernel/diag.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c
index 92fdc35f028c..fb83a21014d0 100644
--- a/arch/s390/kernel/diag.c
+++ b/arch/s390/kernel/diag.c
@@ -9,6 +9,7 @@
 #include <linux/export.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
+#include <linux/kmsan-checks.h>
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/vmalloc.h>
@@ -255,6 +256,7 @@ int diag224(void *ptr)
 		"1:\n"
 		EX_TABLE(0b,1b)
 		: "+d" (rc) :"d" (0), "d" (addr) : "memory");
+	kmsan_unpoison_memory(ptr, PAGE_SIZE);
 	return rc;
 }
 EXPORT_SYMBOL(diag224);
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help