Re: [PATCH] SMACK: Add missing rcu_read_lock/unlock for process capabilitywalk.

From: Casey Schaufler
Date: Thu Apr 21 2011 - 23:56:09 EST


On 4/21/2011 8:58 AM, Andi Kleen wrote:
> On Wed, Apr 20, 2011 at 05:47:40PM -0700, Casey Schaufler wrote:
>> On 4/20/2011 5:08 PM, Andi Kleen wrote:
>>>> The global list, yes. The task specific list, no. Modifying the local
>>>> list is like any other modification of the cred structure and requires
>>>> the cred be copied.
>>> But you still need to free it eventually right? And that freeing will
>>> need RCU on the reader.
>> Entries are never freed from the global list. Someone is working
>> on a patch to do that, but is running into - wait for it - locking
>> issues.
> Then why do you use rcu_read_lock() at all?

Because the entries can be modified in place.

> You can drop all the rcu_read_lock()s and probably the other *_rcu
> list accesses then. And my patch is indeed not needed.
>
>> Entries on the local lists are only freed when the task exits.
> You mean the last user of the cred?

Yes.

> -Andi
>

--
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/