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]
Date:	Tue, 25 Nov 2014 19:59:19 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Aaron Tomlin <atomlin@...hat.com>,
	Pavel Emelyanov <xemul@...allels.com>,
	Serge Hallyn <serge.hallyn@...ntu.com>,
	Sterling Alexander <stalexan@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] exit: pidns: alloc_pid() leaks pid_namespace if
	child_reaper is exiting

On 11/25, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@...hat.com> writes:
>
> > On 11/25, Eric W. Biederman wrote:
> >>
> >> My concern is exposing a half initialized struct pid to the world via an
> >> rcu data structure.  In particular could one of the rcu users get into
> >> trouble because we haven't called get_pid_ns yet?  That is unclear to me.
> >
> > They can't. This pid was fully initialized, in particular
> > pid->numbers[pid->level].ns == ns has a reference.
> >
> > Just it is not ready for put_pid() which will be called by the "owner" of
> > this pid, the caller or the new child. So in this sense it doesn't matter
> > when we call get_pid_ns(), just we need to do this before return.
>
> Or by someone calling find_get_pid() ... put_pid().
>
> Now the reference count should not hit zero in that case

Yes. this get_pid_ns() connects to atomic_set(&pid->count, 1) set by us.

> but I hate to
> think of that case separately.

OK.

> At this point, and especially since we need to Cc stable and get this
> fix backported to who knows how many kernel releases having something
> that is trivial to validate is correct is important.

OK. I'll send V2 with -stable cc'ed.

Oleg.

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