[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100730213256.GA2470@linux.vnet.ibm.com>
Date: Fri, 30 Jul 2010 14:32:56 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: David Howells <dhowells@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Olsa <jolsa@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Dumazet <eric.dumazet@...il.com>,
linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH] cred - synchronize rcu before releasing cred
On Thu, Jul 29, 2010 at 09:34:20AM +0100, David Howells wrote:
> Paul E. McKenney <paulmck@...ux.vnet.ibm.com> wrote:
>
> > It is perfectly legal for an RCU callback to invoke call_rcu(). However,
> > this should be used -only- to wait for RCU readers. If there are no
> > RCU readers, the callback might be re-invoked in very short order,
> > expecially on UP systems.
> >
> > Or am I misunderstanding what you mean by "require call_rcu() to be
> > able to cope iwth requeueing"?
>
> I mean for call_rcu() to be called on an object that's already been
> call_rcu()'d but not yet processed.
That would indeed be very bad!!!
> For example if struct cred gets its usage count reduced to 0, __put_cred()
> will call_rcu() it, but what happens if someone comes along and resurrects it
> by increasing its usage count again? And what happens if the usage count is
> reduced back to zero and __put_cred() calls call_rcu() again before
> put_cred_rcu() has a chance to run?
Doing this would mess up RCU's internal data structures. Mathieu
Desnoyers's recent debug changes (DEBUG_OBJECTS_RCU_HEAD) would catch
this sort of error.
Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists