public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [4/9] SYSCTL: Use RCU strings for core_pattern sysctl
Date: Tue, 05 Jan 2010 12:49:34 +0100	[thread overview]
Message-ID: <87aawsdb5d.fsf@basil.nowhere.org> (raw)
In-Reply-To: <m1zl4t82f8.fsf@fess.ebiederm.org> (Eric W. Biederman's message of "Mon, 04 Jan 2010 22:56:59 -0800")

ebiederm@xmission.com (Eric W. Biederman) writes:
>>  
>> @@ -1421,7 +1421,7 @@ EXPORT_SYMBOL(set_binfmt);
>>  static int format_corename(char *corename, long signr)
>>  {
>>  	const struct cred *cred = current_cred();
>> -	const char *pat_ptr = core_pattern;
>> +	const char *pat_ptr = rcu_dereference(core_pattern);
>
> rcu_dereference should aways be between rcu_read_lock()
> and rcu_read_unlock();

It is, see the call site below:

>> -	 * lock_kernel() because format_corename() is controlled by sysctl, which
>> -	 * uses lock_kernel()
>> +	 * Protect corename by RCU vs proc_rcu_string()
>>  	 */
>> - 	lock_kernel();
>> +	rcu_read_lock();
>>  	ispipe = format_corename(corename, signr);
>> -	unlock_kernel();
>> +	rcu_read_unlock();

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

  reply	other threads:[~2010-01-05 11:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05  2:15 [PATCH] [0/9] SYSCTL: Use RCU to avoid races with string sysctls v2 Andi Kleen
2010-01-05  2:15 ` [PATCH] [1/9] Add rcustring ADT for RCU protected strings v2 Andi Kleen
2010-01-05  5:32   ` Paul E. McKenney
2010-01-05 10:47     ` Andi Kleen
2010-01-05 14:11       ` Paul E. McKenney
2010-01-05 14:19         ` Andi Kleen
2010-01-08 23:50   ` Andrew Morton
2010-01-11 12:12   ` Bert Wesarg
2010-01-11 14:26     ` Andi Kleen
2010-01-05  2:15 ` [PATCH] [2/9] Add a kernel_address() that works for data too Andi Kleen
2010-01-05  8:44   ` Russell King
2010-01-05  8:58   ` Sam Ravnborg
2010-01-05 19:04     ` Russell King
2010-01-05 19:15       ` Andi Kleen
2010-01-08 23:51         ` Andrew Morton
2010-01-05  2:15 ` [PATCH] [3/9] SYSCTL: Add proc_rcu_string to manage sysctls using rcu strings Andi Kleen
2010-01-05  2:15 ` [PATCH] [4/9] SYSCTL: Use RCU strings for core_pattern sysctl Andi Kleen
2010-01-05  6:56   ` Eric W. Biederman
2010-01-05 11:49     ` Andi Kleen [this message]
2010-01-05  2:15 ` [PATCH] [5/9] SYSCTL: Add call_usermodehelper_cleanup() Andi Kleen
2010-01-05  2:15 ` [PATCH] [6/9] SYSCTL: Convert modprobe_path to proc_rcu_string() Andi Kleen
2010-01-05  2:15 ` [PATCH] [7/9] SYSCTL: Convert poweroff_command to proc_rcu_string Andi Kleen
2010-01-05  2:15 ` [PATCH] [8/9] SYSCTL: Convert hotplug helper string to proc_rcu_string() Andi Kleen
2010-01-05  2:15 ` [PATCH] [9/9] SYSCTL: Use RCU protected sysctl for ocfs group add helper Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aawsdb5d.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox