kcov-kmsan-unpoison-area-list-in-kcov_remote_area_put.patch removed from -mm tree
The quilt patch titled
Subject: kcov: kmsan: unpoison area->list in kcov_remote_area_put()
has been removed from the -mm tree. Its filename was
kcov-kmsan-unpoison-area-list-in-kcov_remote_area_put.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: kcov: kmsan: unpoison area->list in kcov_remote_area_put()
Date: Thu, 15 Sep 2022 17:04:03 +0200
KMSAN does not instrument kernel/kcov.c for performance reasons (with CONFIG_KCOV=y virtually every place in the kernel invokes kcov instrumentation). Therefore the tool may miss writes from kcov.c that initialize memory.
When CONFIG_DEBUG_LIST is enabled, list pointers from kernel/kcov.c are passed to instrumented helpers in lib/list_debug.c, resulting in false positives.
To work around these reports, we unpoison the contents of area->list after initializing it.
---
kernel/kcov.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/kcov.c renamed from kernel/kcov.c~kcov-kmsan-unpoison-area-list-in-kcov_remote_area_put +7 -0
@@ -11,6 +11,7 @@#include <linux/fs.h> #include <linux/hashtable.h> #include <linux/init.h> +#include <linux/kmsan-checks.h> #include <linux/mm.h> #include <linux/preempt.h> #include <linux/printk.h>
@@ -152,6 +153,12 @@ static void kcov_remote_area_put(structINIT_LIST_HEAD (&area->list); area->size = size;list_add (&area->list, &kcov_remote_areas); +/* +* KMSAN doesn't instrument this file, so it may not know area->list +* is initialized. Unpoison it explicitly to avoid reports in +* kcov_remote_area_get(). +*/ +kmsan_unpoison_memory (&area->list,sizeof (area->list)); } static notrace bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t)
_
Patches currently in -mm which might be from [email protected] are