lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1002101938000.2811@localhost.localdomain>
Date:	Wed, 10 Feb 2010 19:39:22 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	"Serge E. Hallyn" <serue@...ibm.com>,
	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
	oleg@...hat.com, linux-kernel@...r.kernel.org,
	paulmck@...ux.vnet.ibm.com, linux-security-module@...r.kernel.org
Subject: Re: [PATCH] Update comment on find_task_by_pid_ns

On Wed, 10 Feb 2010, Andrew Morton wrote:
> On Wed, 10 Feb 2010 10:30:33 -0600 "Serge E. Hallyn" <serue@...ibm.com> wrote:
> 
> > Quoting Andrew Morton (akpm@...ux-foundation.org):
> > > On Tue, 9 Feb 2010 06:42:45 +0900
> > > Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp> wrote:
> > > 
> > > > OK. I updated description.
> > > > 
> > > > As of 2.6.32 , below users are missing rcu_read_lock().
> > > > 
> > > > Users missing rcu_read_lock() when calling find_task_by_vpid():
> > > > 
> > > >   SYSCALL_DEFINE3(ioprio_set) in fs/ioprio.c
> > > >   SYSCALL_DEFINE2(ioprio_get) in fs/ioprio.c
> > > >   cap_get_target_pid() in kernel/capability.c
> > > 
> > > Actually, cap_get_target_pid() uses rcu_read_lock() and doesn't take
> > > tasklist_lock.
> > 
> > Hmm - is that in -mm?  In my copy here it takes read_lock(&tasklist_lock)
> 
> yup.  It got changed in linux-next.
> 
> > And I'll admit I'm a bit confused as to the current state of things:
> > do I understand correctly that we now need to take both the tasklist_lock
> > and rcu_read_lock?  (Presumably only for read_lock()?)
> 
> Beats me.  We need to protect both the pid->task_struct lookup data
> structures (during the lookup) and protect the resulting task_struct
> while the caller is playing with it.  It's unclear whether
> rcu_read_lock() suffices for both purposes.

The rcu_read_lock section is sufficient. task_struct can not go away
before the rcu_read_unlock()

Thanks,

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ