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: <20071126225517.0245a86d.akpm@linux-foundation.org>
Date:	Mon, 26 Nov 2007 22:55:17 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"Serge E. Hallyn" <serue@...ibm.com>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Containers <containers@...ts.osdl.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] utsns: Restore proper namespace handling.

On Mon, 26 Nov 2007 09:19:17 -0600 "Serge E. Hallyn" <serue@...ibm.com> wrote:

> Quoting Eric W. Biederman (ebiederm@...ssion.com):
> > 
> > When CONFIG_UTS_NS was removed it seems that we also deleted
> > the code for handling sysctls in the other then the initial
> > uts namespace.   This patch restores that code.
> > 
> > Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
> 
> Thanks, Eric.
> 
> Acked-by: Serge Hallyn <serue@...ibm.com>
> 
> > ---
> >  kernel/utsname_sysctl.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c
> > index c76c064..71f58c3 100644
> > --- a/kernel/utsname_sysctl.c
> > +++ b/kernel/utsname_sysctl.c
> > @@ -18,6 +18,8 @@
> >  static void *get_uts(ctl_table *table, int write)
> >  {
> >  	char *which = table->data;
> > +	struct uts_namespace *uts_ns = current->nsproxy->uts_ns;
> > +	which = (which - (char *)&init_uts_ns) + (char *)uts_ns;
> > 
> >  	if (!write)
> >  		down_read(&uts_sem);

I already have a (more codingstylely attractive) version of this from
Pavel, for which I shall steal your ack.

--- a/kernel/utsname_sysctl.c~isolate-the-uts-namespaces-domainname-and-hostname-back
+++ a/kernel/utsname_sysctl.c
@@ -18,6 +18,10 @@
 static void *get_uts(ctl_table *table, int write)
 {
 	char *which = table->data;
+	struct uts_namespace *uts_ns;
+
+	uts_ns = current->nsproxy->uts_ns;
+	which = (which - (char *)&init_uts_ns) + (char *)uts_ns;
 
 	if (!write)
 		down_read(&uts_sem);
_


Those pointer tricksies are revolting.  What's going on in there?
-
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