[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-1e6f85cb6771d54c9346270d7b0667500d9f3eab@git.kernel.org>
Date: Wed, 14 Oct 2015 08:29:02 -0700
From: tip-bot for Andrey Ryabinin <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: luto@...capital.net, kcc@...gle.com, akpm@...ux-foundation.org,
torvalds@...ux-foundation.org, peterz@...radead.org,
glider@...gle.com, dvyukov@...gle.com, mingo@...nel.org,
linux-kernel@...r.kernel.org, sasha.levin@...cle.com,
wmglo@...t.med.uni-muenchen.de, aryabinin@...tuozzo.com,
tglx@...utronix.de, hpa@...or.com, kasan-dev@...glegroups.com,
andreyknvl@...gle.com, bp@...en8.de, dvlasenk@...hat.com,
paulmck@...ux.vnet.ibm.com
Subject: [tip:locking/urgent] x86/mm: Silence KASAN warnings in get_wchan(
)
Commit-ID: 1e6f85cb6771d54c9346270d7b0667500d9f3eab
Gitweb: http://git.kernel.org/tip/1e6f85cb6771d54c9346270d7b0667500d9f3eab
Author: Andrey Ryabinin <aryabinin@...tuozzo.com>
AuthorDate: Tue, 13 Oct 2015 18:28:08 +0300
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 14 Oct 2015 16:44:06 +0200
x86/mm: Silence KASAN warnings in get_wchan()
get_wchan() is racy by design, it may access volatile stack
of running task, thus it may access redzone in a stack frame
and cause KASAN to warn about this.
Use READ_ONCE_NOCHECK() to silence these warnings.
Reported-by: Sasha Levin <sasha.levin@...cle.com>
Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Alexander Potapenko <glider@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@...gle.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Kostya Serebryany <kcc@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Wolfram Gloger <wmglo@...t.med.uni-muenchen.de>
Cc: kasan-dev <kasan-dev@...glegroups.com>
Link: http://lkml.kernel.org/r/1444750088-24444-3-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/process.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 39e585a..e28db18 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -550,14 +550,14 @@ unsigned long get_wchan(struct task_struct *p)
if (sp < bottom || sp > top)
return 0;
- fp = READ_ONCE(*(unsigned long *)sp);
+ fp = READ_ONCE_NOCHECK(*(unsigned long *)sp);
do {
if (fp < bottom || fp > top)
return 0;
- ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));
+ ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long)));
if (!in_sched_functions(ip))
return ip;
- fp = READ_ONCE(*(unsigned long *)fp);
+ fp = READ_ONCE_NOCHECK(*(unsigned long *)fp);
} while (count++ < 16 && p->state != TASK_RUNNING);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists