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] [day] [month] [year] [list]
Message-ID: <20070626225104.GA24431@sergelap.austin.ibm.com>
Date:	Tue, 26 Jun 2007 17:51:04 -0500
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	"Serge E. Hallyn" <serue@...ibm.com>, menage@...gle.com, dev@...ru,
	xemul@...ru, vatsa@...ibm.com, ebiederm@...ssion.com,
	haveblue@...ibm.com, svaidy@...ux.vnet.ibm.com, balbir@...ibm.com,
	pj@....com, cpw@....com, ckrm-tech@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, containers@...ts.osdl.org,
	mbligh@...gle.com, rohitseth@...gle.com, devel@...nvz.org
Subject: Re: [PATCH 2/2] containers: implement namespace tracking subsystem (v3)

Quoting Andrew Morton (akpm@...ux-foundation.org):
> On Wed, 13 Jun 2007 18:01:25 -0500
> "Serge E. Hallyn" <serue@...ibm.com> wrote:
> 
> > @@ -177,6 +184,15 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,
> >  	if (IS_ERR(*new_nsp)) {
> >  		err = PTR_ERR(*new_nsp);
> >  		put_nsproxy(old_ns);
> > +		goto out;
> > +	}
> > +
> > +	err = ns_container_clone(current);
> > +	if (err) {
> > +		put_nsproxy(*new_nsp);
> > +		put_nsproxy(old_ns);
> >  	}
> > +
> > +out:
> >  	return err;
> >  }
> 
> I had to fix a reject here: the put_nsproxy(old_ns) has disappeared from
> this code.

Thanks Andrew, end result looks good.

-serge

> end result:
> 
> int unshare_nsproxy_namespaces(unsigned long unshare_flags,
> 		struct nsproxy **new_nsp, struct fs_struct *new_fs)
> {
> 	int err = 0;
> 
> 	if (!(unshare_flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC |
> 			       CLONE_NEWUSER)))
> 		return 0;
> 
> 	if (!capable(CAP_SYS_ADMIN))
> 		return -EPERM;
> 
> 	*new_nsp = create_new_namespaces(unshare_flags, current,
> 				new_fs ? new_fs : current->fs);
> 	if (IS_ERR(*new_nsp))
> 		err = PTR_ERR(*new_nsp);
> 		goto out;
> 	}
> 
> 	err = ns_container_clone(current);
> 	if (err)
> 		put_nsproxy(*new_nsp);
> 
> out:
> 	return err;
> }
-
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