mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ftrace: remove KASAN poison in ftrace_ops_test()
@ 2018-11-11 15:10 Zhizhou Zhang
  2018-11-11 17:32 ` Mark Rutland
  0 siblings, 1 reply; 5+ messages in thread
From: Zhizhou Zhang @ 2018-11-11 15:10 UTC (permalink / raw)
  To: rostedt, mingo; +Cc: linux-kernel, zhizhouzhang, zhizhouzh

ftrace_ops_test() passed local varible parameter to hash_contains_ip(),
which could result KASAN stack-out-of-bounds warning.

Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
---
 kernel/trace/ftrace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f536f60..6e11f90 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1522,6 +1522,8 @@ ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs)
 	rcu_assign_pointer(hash.filter_hash, ops->func_hash->filter_hash);
 	rcu_assign_pointer(hash.notrace_hash, ops->func_hash->notrace_hash);
 
+	kasan_unpoison_task_stack(current);
+
 	if (hash_contains_ip(ip, &hash))
 		ret = 1;
 	else
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-14 10:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-11 15:10 [PATCH] ftrace: remove KASAN poison in ftrace_ops_test() Zhizhou Zhang
2018-11-11 17:32 ` Mark Rutland
2018-11-12  8:09   ` Zhang Zhizhou(张治洲)
2018-11-13 17:47     ` Mark Rutland
2018-11-14 10:33       ` Zhang Zhizhou(张治洲)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®