[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231214055539.9420-8-nicholas@linux.ibm.com>
Date: Thu, 14 Dec 2023 05:55:33 +0000
From: Nicholas Miehlbradt <nicholas@...ux.ibm.com>
To: glider@...gle.com, elver@...gle.com, dvyukov@...gle.com,
akpm@...ux-foundation.org, mpe@...erman.id.au, npiggin@...il.com,
christophe.leroy@...roup.eu
Cc: linux-mm@...ck.org, kasan-dev@...glegroups.com, iii@...ux.ibm.com,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Nicholas Miehlbradt <nicholas@...ux.ibm.com>
Subject: [PATCH 07/13] powerpc/kprobes: Unpoison instruction in kprobe struct
KMSAN does not unpoison the ainsn field of a kprobe struct correctly.
Manually unpoison it to prevent false positives.
Signed-off-by: Nicholas Miehlbradt <nicholas@...ux.ibm.com>
---
arch/powerpc/kernel/kprobes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index b20ee72e873a..1cbec54f2b6a 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -27,6 +27,7 @@
#include <asm/sections.h>
#include <asm/inst.h>
#include <linux/uaccess.h>
+#include <linux/kmsan-checks.h>
DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
@@ -179,6 +180,7 @@ int arch_prepare_kprobe(struct kprobe *p)
if (!ret) {
patch_instruction(p->ainsn.insn, insn);
+ kmsan_unpoison_memory(p->ainsn.insn, sizeof(kprobe_opcode_t));
p->opcode = ppc_inst_val(insn);
}
--
2.40.1
Powered by blists - more mailing lists