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: <006C93D3-B9F6-44C9-8D1E-DA95E38BD0A6@xmission.com>
Date:	Tue, 12 May 2015 10:58:19 -0500
From:	"Eric W. Biederman" <ebiederm@...ssion.com>
To:	David Laight <David.Laight@...LAB.COM>,
	"'nicolas.dichtel@...nd.com'" <nicolas.dichtel@...nd.com>,
	"davem@...emloft.net" <davem@...emloft.net>
CC:	Ying Xue <ying.xue@...driver.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"cwang@...pensource.com" <cwang@...pensource.com>,
	"xemul@...nvz.org" <xemul@...nvz.org>,
	"eric.dumazet@...il.com" <eric.dumazet@...il.com>,
	"maxk@....qualcomm.com" <maxk@....qualcomm.com>,
	"stephen@...workplumber.org" <stephen@...workplumber.org>,
	"tgraf@...g.ch" <tgraf@...g.ch>,
	"tom@...bertland.com" <tom@...bertland.com>,
	"jchapman@...alix.com" <jchapman@...alix.com>,
	"erik.hugne@...csson.com" <erik.hugne@...csson.com>,
	"jon.maloy@...csson.com" <jon.maloy@...csson.com>,
	"horms@...ge.net.au" <horms@...ge.net.au>,
	Herbert Xu <herbert@...dor.apana.org.au>
Subject: RE: [PATCH 2/6] net: Add a struct net parameter to sock_create_kern



On May 12, 2015 8:16:23 AM CDT, David Laight <David.Laight@...LAB.COM> wrote:
>From: Nicolas Dichtel [mailto:nicolas.dichtel@...nd.com]
>> Sent: 12 May 2015 13:29
>> Le 12/05/2015 13:48, David Laight a écrit :
>> > From: Eric W. Biederman
>> >> Sent: 12 May 2015 09:55
>> >>
>> >> On May 12, 2015 3:24:11 AM CDT, David Laight
><David.Laight@...LAB.COM> wrote:
>> > ...
>> >>> Wouldn't it involve far less churn to add a new function that
>uses a
>> >>> non-default namespace?
>> >>
>> >> The goal is comprehensible and maintainable kernel code.
>> >>
>> >> Which network namespace your socket is in, is an important
>property and something you probably care
>> >> about if you are creating kernel sockets.
>> >
>> > That rather depends on whether you've anywhere to get a namespace
>from.
>> > eg something like ceph/messenger.c
>> sk_net(con->sock->sk)?
>
>What if you don't already have a socket?
>Just an IP(v6) address ?
>
>> This parameter is essential, hiding it will just hides bugs.
>> Having this parameter forces the developer to ask himself what is the
>best
>> value.
>
>What if the answer is 'NFI'?
>Which requires the answer be pushed back to the 'application'
>configuration?
>Most users will have no idea either.

current->nsproxy->netns.

Capture it at mount time.  Call get_net then and put_net after you have cleaned up during unmount.

Not hard, and the parameter is doing what it is supposed to be doing getting you to ask the question, and realize there is an unhandled issue.

Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ