x86-kmsan-skip-shadow-checks-in-__switch_to.patch removed from -mm tree
The quilt patch titled
Subject: x86: kmsan: skip shadow checks in __switch_to()
has been removed from the -mm tree. Its filename was
x86-kmsan-skip-shadow-checks-in-__switch_to.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: skip shadow checks in __switch_to()
Date: Thu, 15 Sep 2022 17:04:07 +0200
When instrumenting functions, KMSAN obtains the per-task state (mostly pointers to metadata for function arguments and return values) once per function at its beginning, using the current pointer.
Every time the instrumented function calls another function, this state (struct kmsan_context_state) is updated with shadow/origin data of the passed and returned values.
When current changes in the low-level arch code, instrumented code can not notice that, and will still refer to the old state, possibly corrupting it or using stale data. This may result in false positive reports.
To deal with that, we need to apply __no_kmsan_checks to the functions performing context switching - this will result in skipping all KMSAN shadow checks and marking newly created values as initialized, preventing all false positive reports in those functions. False negatives are still possible, but we expect them to be rare and impersistent.
---
arch/x86/kernel/process_64.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/process_64.c renamed from arch/x86/kernel/process_64.c~x86-kmsan-skip-shadow-checks-in-__switch_to +1 -0
@@ -553,6 +553,7 @@ void compat_start_thread(struct pt_regs* Kprobes not supported here. Set the probe on schedule instead. * Function graph tracer not supported too. */ +__no_kmsan_checks __visible __notrace_funcgraph struct task_struct *__switch_to (struct task_struct *prev_p,struct task_struct *next_p) {
_
Patches currently in -mm which might be from [email protected] are