* [merged] kmemleak-clear-stale-pointers-from-task-stacks.patch removed from -mm tree
@ 2017-10-16 19:55 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-10-16 19:55 UTC (permalink / raw)
To: catalin.marinas, khlebnikov, mm-commits
The patch titled
Subject: kmemleak: clear stale pointers from task stacks
has been removed from the -mm tree. Its filename was
kmemleak-clear-stale-pointers-from-task-stacks.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Subject: kmemleak: clear stale pointers from task stacks
Kmemleak considers any pointers on task stacks as references. This patch
clears newly allocated and reused vmap stacks.
Link: http://lkml.kernel.org/r/150728990124.744199.8403409836394318684.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/thread_info.h | 2 +-
kernel/fork.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff -puN include/linux/thread_info.h~kmemleak-clear-stale-pointers-from-task-stacks include/linux/thread_info.h
--- a/include/linux/thread_info.h~kmemleak-clear-stale-pointers-from-task-stacks
+++ a/include/linux/thread_info.h
@@ -42,7 +42,7 @@ enum {
#define THREAD_ALIGN THREAD_SIZE
#endif
-#ifdef CONFIG_DEBUG_STACK_USAGE
+#if IS_ENABLED(CONFIG_DEBUG_STACK_USAGE) || IS_ENABLED(CONFIG_DEBUG_KMEMLEAK)
# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \
__GFP_ZERO)
#else
diff -puN kernel/fork.c~kmemleak-clear-stale-pointers-from-task-stacks kernel/fork.c
--- a/kernel/fork.c~kmemleak-clear-stale-pointers-from-task-stacks
+++ a/kernel/fork.c
@@ -215,6 +215,10 @@ static unsigned long *alloc_thread_stack
if (!s)
continue;
+#ifdef CONFIG_DEBUG_KMEMLEAK
+ /* Clear stale pointers from reused stack. */
+ memset(s->addr, 0, THREAD_SIZE);
+#endif
tsk->stack_vm_area = s;
return s->addr;
}
_
Patches currently in -mm which might be from khlebnikov@yandex-team.ru are
kmemleak-change-sys-kernel-debug-kmemleak-permissions-from-0444-to-0644.patch
proc-do-not-show-vmexe-bigger-than-total-executable-virtual-memory.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-16 19:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 19:55 [merged] kmemleak-clear-stale-pointers-from-task-stacks.patch removed from -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).