Re: [PATCH] [4/9] SYSCTL: Use RCU strings for core_pattern sysctl

From: Andi Kleen
Date: Tue Jan 05 2010 - 06:49:46 EST


ebiederm@xxxxxxxxxxxx (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@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/