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]
Message-ID: <1322877399.30977.68.camel@frodo>
Date:	Fri, 02 Dec 2011 20:56:39 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Ingo Molnar <mingo@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Tejun Heo <tj@...nel.org>
Subject: [PATCH][GIT PULL][v3.2] trace_events_filter: Use
 rcu_assign_pointer() when setting ftrace_event_call->filter


Ingo,

Please pull the latest tip/perf/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/urgent

Head SHA1: d3d9acf646679c1981032b0985b386d12fccc60c


Tejun Heo (1):
      trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter

----
 kernel/trace/trace_events_filter.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---------------------------
commit d3d9acf646679c1981032b0985b386d12fccc60c
Author: Tejun Heo <tj@...nel.org>
Date:   Wed Nov 23 08:49:49 2011 -0800

    trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
    
    ftrace_event_call->filter is sched RCU protected but didn't use
    rcu_assign_pointer().  Use it.
    
    TODO: Add proper __rcu annotation to call->filter and all its users.
    
    -v2: Use RCU_INIT_POINTER() for %NULL clearing as suggested by Eric.
    
    Link: http://lkml.kernel.org/r/20111123164949.GA29639@google.com
    
    Cc: Eric Dumazet <eric.dumazet@...il.com>
    Cc: Frederic Weisbecker <fweisbec@...il.com>
    Cc: Jiri Olsa <jolsa@...hat.com>
    Cc: stable@...nel.org # (2.6.39+)
    Signed-off-by: Tejun Heo <tj@...nel.org>
    Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 816d3d0..d6e7926 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1686,7 +1686,7 @@ static int replace_system_preds(struct event_subsystem *system,
 		 * replace the filter for the call.
 		 */
 		filter = call->filter;
-		call->filter = filter_item->filter;
+		rcu_assign_pointer(call->filter, filter_item->filter);
 		filter_item->filter = filter;
 
 		fail = false;
@@ -1741,7 +1741,7 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
 		filter = call->filter;
 		if (!filter)
 			goto out_unlock;
-		call->filter = NULL;
+		RCU_INIT_POINTER(call->filter, NULL);
 		/* Make sure the filter is not being used */
 		synchronize_sched();
 		__free_filter(filter);
@@ -1782,7 +1782,7 @@ out:
 	 * string
 	 */
 	tmp = call->filter;
-	call->filter = filter;
+	rcu_assign_pointer(call->filter, filter);
 	if (tmp) {
 		/* Make sure the call is done with the filter */
 		synchronize_sched();


Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ