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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 4 May 2017 09:00:06 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Cong Wang' <xiyou.wangcong@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: sock_create_kern() and (lack of) get_net()

From: Cong Wang
> Sent: 03 May 2017 17:33
> On Wed, May 3, 2017 at 4:39 AM, David Laight <David.Laight@...lab.com> wrote:
> > I suspect that many of the sockets created with 'kern=1' are not 'special'
> > and should hold a reference to the namespace.
> 
> They are special if they are created in net init, which means they
> have the same life-time with netns. They should NOT hold a refcnt,
> otherwise who would release the last netns refcnt? net exit is called
> when refcnt reaches 0, if you really held it, it is always at least 1.

Right, so some are 'special' but some aren't?

At the moment no sockets created in the kernel hold a reference to the
namespace, deleting the namespace won't magically cause the kernel
module that created the socket to delete it.
If the socket is being used for a TCP connection then in can sit in
one of the FIN-WAIT states after sock_release() has been called
(I'm not sure exactly when the 'sock' and 'socket' get freed).

I guess it would be possible for the namespace deleting code to
traverse the list of sockets that reference the namespace and 'unhook'
then all from the relevant protocol stack so that any 'user' calls
error out.
It would need to allow for threads blocked inside the socket functions.

Does any of that happen?

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ