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-next>] [day] [month] [year] [list]
Message-Id: <20210118143932.56069-1-dong.menglong@zte.com.cn>
Date:   Mon, 18 Jan 2021 22:39:29 +0800
From:   menglong8.dong@...il.com
To:     kuba@...nel.org, christian.brauner@...ntu.com
Cc:     davem@...emloft.net, yoshfuji@...ux-ipv6.org,
        dong.menglong@....com.cn, daniel@...earbox.net, gnault@...hat.com,
        ast@...nel.org, nicolas.dichtel@...nd.com, ap420073@...il.com,
        edumazet@...gle.com, pabeni@...hat.com, jakub@...udflare.com,
        bjorn.topel@...el.com, keescook@...omium.org,
        viro@...iv.linux.org.uk, rdna@...com, maheshb@...gle.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next 0/3] Namespace-ify some sysctl in net/core

From: Menglong Dong <dong.menglong@....com.cn>

For now, most sysctl in 'net/core' are globally unified, such as
sysctl_wmem_default, sysctl_rmem_default, sysctl_wmem_default,
sysctl_rmem_default, etc.

It's not convenient in some case. For example, when we use docker
and try to control the default udp socket receive buffer for
each container by sysctl_rmem_default.

For that reason, I namespace-ify some sysctl in 'net/core', which
are sysctl_wmem_default, sysctl_rmem_default, sysctl_wmem_default
and sysctl_rmem_default.

In the first patch, I made some adjustments to the initialization
of netns_core_table.

The second patch make sysctl_wmem_default and sysctl_rmem_default
per-namespace, and the third patch make sysctl_wmem_max and
sysctl_rmem_max per-namespace.

After these patch, sysctl above are pre-namespace, for example:

$ cat /proc/sys/net/core/rmem_default
1024000
$ ip netns exec test cat /proc/sys/net/core/rmem_default
212992
$ ip netns exec test2 cat /proc/sys/net/core/rmem_default
2048000

Thanks for Christian's patient explaining to make these patches a
single series~

Menglong Dong (3):
  net: core: init every ctl_table in netns_core_table
  net: core: Namespace-ify sysctl_wmem_default and sysctl_rmem_default
  net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max

 include/net/netns/core.h        |  4 ++
 include/net/sock.h              |  6 ---
 net/core/filter.c               |  4 +-
 net/core/net_namespace.c        |  4 ++
 net/core/sock.c                 | 18 +++-----
 net/core/sysctl_net_core.c      | 76 +++++++++++++++++----------------
 net/ipv4/ip_output.c            |  2 +-
 net/ipv4/tcp_output.c           |  2 +-
 net/netfilter/ipvs/ip_vs_sync.c |  4 +-
 9 files changed, 60 insertions(+), 60 deletions(-)


base-commit: 5ee88057889bbca5f5bb96031b62b3756b33e164
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ