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  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:   Mon, 13 Nov 2017 18:09:32 -0800
From:   Cong Wang <>
To:     Tonghao Zhang <>
Cc:     Linux Kernel Network Developers <>,
        Tonghao Zhang <>,
        Martin Zhang <>
Subject: Re: [PATCH v2 net-next] socket: Move the socket inuse to namespace.

On Mon, Nov 13, 2017 at 4:36 AM, Tonghao Zhang <> wrote:
> From: Tonghao Zhang <>
> This patch add a member in struct netns_core. and this is
> a counter for socket_inuse in the _net_ namespace. The patch
> will add/sub counter in the sock_alloc or sock_release. In
> the sock_alloc, the private data of inode saves the special
> _net_. When releasing it, we can access the special _net_ and
> dec the counter of socket in that namespace.
> By the way, we dont use the 'current->nsproxy->net_ns' in the
> sock_release. In one case´╝îwhen one task exits, the 'do_exit'
> may set the current->nsproxy NULL, and then call the sock_release.
> Use the private data of inode, saving few bytes.

Why do you need to hold netns refcnt for socket? sock already holds
it, so you can just access it by sock_net(sock->sk) ?

Powered by blists - more mailing lists