lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  5 Feb 2020 17:18:08 -0500
From:   "Joel Fernandes (Google)" <joel@...lfernandes.org>
To:     linux-kernel@...r.kernel.org
Cc:     "Joel Fernandes (Google)" <joel@...lfernandes.org>,
        Ingo Molnar <mingo@...hat.com>,
        Steven Rostedt <rostedt@...dmis.org>, paulmck@...nel.org,
        frextrite@...il.com, rcu@...r.kernel.org,
        madhuparnabhowmik04@...il.com
Subject: [PATCH] kernel/trace: Use rcu_assign_pointer() for setting fgraph hash pointers

set_ftrace_early_graph() sets pointers without any explicit
release-barriers. Let us use rcu_assign_pointer() to ensure the same.

Note that ftrace_early_graph() calls ftrace_graph_set_hash() which does
do mutex_unlock(&ftrace_lock); which should imply a release barrier.
However it is better to not depend on it and just use
rcu_assign_pointer() which should also avoid sparse errors in the
future.

Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>

---
 kernel/trace/ftrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 959ded08dc13f..340d30557a10e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5477,9 +5477,9 @@ static void __init set_ftrace_early_graph(char *buf, int enable)
 	}
 
 	if (enable)
-		ftrace_graph_hash = hash;
+		rcu_assign_pointer(ftrace_graph_hash, hash);
 	else
-		ftrace_graph_notrace_hash = hash;
+		rcu_assign_pointer(ftrace_graph_notrace_hash, hash);
 }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-- 
2.25.0.341.g760bfbb309-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ