[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110420231859.GB32402@tassilo.jf.intel.com>
Date: Wed, 20 Apr 2011 16:18:59 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Casey Schaufler <casey@...aufler-ca.com>
Cc: Andi Kleen <andi@...stfloor.org>, jmorris@...ei.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] SMACK: Add missing rcu_read_lock/unlock for process
capability walk.
On Wed, Apr 20, 2011 at 03:51:41PM -0700, Casey Schaufler wrote:
> On 4/20/2011 3:00 PM, Andi Kleen wrote:
> > From: Andi Kleen <ak@...ux.intel.com>
> >
> > smk_access_entry does a RCU list walk for a list shared with other
> > threads. It relies on the caller doing rcu_read_lock().
> > One caller forgot to do to this, which could lead to races
> > on preemptible kernels.
> >
> > Move the rcu_read_lock() into smk_access_entry instead.
>
> Nacked-by: Casey Schaufler <casey@...aufler-ca.com>
>
> The lock was moved out of smk_access_entry in support of the
> processing done in the smack_mmap_file() hook. Where do you see
> a potential race, and which caller "forgot" to do the lock?
There are two callers and only one takes it.
The one that doesn't take it is smk_curacc.
I checked the callers of that and there is no rcu_read_lock() in those
As far as I understand the cred which holds this list is shared
between threads and other threads can modify it. Which means
it needs RCU read lock protection.
-Andi
--
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