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]
Date: Wed, 1 May 2024 15:22:08 +0200
From: Sabrina Dubroca <sd@...asysnail.net>
To: j.granados@...sung.com
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Alexander Aring <alex.aring@...il.com>,
	Stefan Schmidt <stefan@...enfreihafen.org>,
	Miquel Raynal <miquel.raynal@...tlin.com>,
	David Ahern <dsahern@...nel.org>,
	Steffen Klassert <steffen.klassert@...unet.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Matthieu Baerts <matttbe@...nel.org>,
	Mat Martineau <martineau@...nel.org>,
	Geliang Tang <geliang@...nel.org>,
	Remi Denis-Courmont <courmisch@...il.com>,
	Allison Henderson <allison.henderson@...cle.com>,
	David Howells <dhowells@...hat.com>,
	Marc Dionne <marc.dionne@...istor.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
	Xin Long <lucien.xin@...il.com>,
	Wenjia Zhang <wenjia@...ux.ibm.com>,
	Jan Karcher <jaka@...ux.ibm.com>,
	"D. Wythe" <alibuda@...ux.alibaba.com>,
	Tony Lu <tonylu@...ux.alibaba.com>,
	Wen Gu <guwen@...ux.alibaba.com>,
	Trond Myklebust <trond.myklebust@...merspace.com>,
	Anna Schumaker <anna@...nel.org>,
	Chuck Lever <chuck.lever@...cle.com>,
	Jeff Layton <jlayton@...nel.org>, Neil Brown <neilb@...e.de>,
	Olga Kornievskaia <kolga@...app.com>, Dai Ngo <Dai.Ngo@...cle.com>,
	Tom Talpey <tom@...pey.com>, Jon Maloy <jmaloy@...hat.com>,
	Ying Xue <ying.xue@...driver.com>, Martin Schiller <ms@....tdt.de>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Jozsef Kadlecsik <kadlec@...filter.org>,
	Florian Westphal <fw@...len.de>, Roopa Prabhu <roopa@...dia.com>,
	Nikolay Aleksandrov <razor@...ckwall.org>,
	Simon Horman <horms@...ge.net.au>, Julian Anastasov <ja@....bg>,
	Joerg Reuter <jreuter@...na.de>,
	Luis Chamberlain <mcgrof@...nel.org>,
	Kees Cook <keescook@...omium.org>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, dccp@...r.kernel.org,
	linux-wpan@...r.kernel.org, mptcp@...ts.linux.dev,
	linux-hams@...r.kernel.org, linux-rdma@...r.kernel.org,
	rds-devel@....oracle.com, linux-afs@...ts.infradead.org,
	linux-sctp@...r.kernel.org, linux-s390@...r.kernel.org,
	linux-nfs@...r.kernel.org, tipc-discussion@...ts.sourceforge.net,
	linux-x25@...r.kernel.org, netfilter-devel@...r.kernel.org,
	coreteam@...filter.org, bridge@...ts.linux.dev,
	lvs-devel@...r.kernel.org
Subject: Re: [PATCH net-next v6 0/8] sysctl: Remove sentinel elements from
 networking

2024-05-01, 11:29:24 +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados <j.granados@...sung.com>
> 
> What?
> These commits remove the sentinel element (last empty element) from the
> sysctl arrays of all the files under the "net/" directory that register
> a sysctl array. The merging of the preparation patches [4] to mainline
> allows us to just remove sentinel elements without changing behavior.
> This is safe because the sysctl registration code (register_sysctl() and
> friends) use the array size in addition to checking for a sentinel [1].
> 
> Why?
> By removing the sysctl sentinel elements we avoid kernel bloat as
> ctl_table arrays get moved out of kernel/sysctl.c into their own
> respective subsystems. This move was started long ago to avoid merge
> conflicts; the sentinel removal bit came after Mathew Wilcox suggested
> it to avoid bloating the kernel by one element as arrays moved out. This
> patchset will reduce the overall build time size of the kernel and run
> time memory bloat by about ~64 bytes per declared ctl_table array (more
> info here [5]).
> 
> When are we done?
> There are 4 patchest (25 commits [2]) that are still outstanding to
> completely remove the sentinels: files under "net/" (this patchset),
> files under "kernel/" dir, misc dirs (files under mm/ security/ and
> others) and the final set that removes the unneeded check for ->procname
> == NULL.
> 
> Testing:
> * Ran sysctl selftests (./tools/testing/selftests/sysctl/sysctl.sh)
> * Ran this through 0-day with no errors or warnings
> 
> Savings in vmlinux:
>   A total of 64 bytes per sentinel is saved after removal; I measured in
>   x86_64 to give an idea of the aggregated savings. The actual savings
>   will depend on individual kernel configuration.
>     * bloat-o-meter
>         - The "yesall" config saves 3976 bytes (bloat-o-meter output [6])
>         - A reduced config [3] saves 1263 bytes (bloat-o-meter output [7])
> 
> Savings in allocated memory:
>   None in this set but will occur when the superfluous allocations are
>   removed from proc_sysctl.c. I include it here for context. The
>   estimated savings during boot for config [3] are 6272 bytes. See [8]
>   for how to measure it.
> 
> Comments/feedback greatly appreciated
> 
> Changes in v6:
> - Rebased onto net-next/main.
> - Besides re-running my cocci scripts, I ran a new find script [9].
>   Found 0 hits in net/
> - Moved "i" variable declaraction out of for() in sysctl_core_net_init
> - Removed forgotten sentinel in mpls_table
> - Removed CONFIG_AX25_DAMA_SLAVE guard from net/ax25/ax25_ds_timer.c. It
>   is not needed because that file is compiled only when
>   CONFIG_AX25_DAMA_SLAVE is set.
> - When traversing smc_table, stop on ARRAY_SIZE instead of ARRAY_SIZE-1.
> - Link to v5: https://lore.kernel.org/r/20240426-jag-sysctl_remset_net-v5-0-e3b12f6111a6@samsung.com

I pointed out a few tiny details in the ax25 patch but either way, the
series looks good to me. Thanks!

Series:
Reviewed-by: Sabrina Dubroca <sd@...asysnail.net>

Note that you could have kept the ack/reviewed-by on patch 4 since it
was not modified. Jeff and Chuck, your reviews got lost in the repost.

-- 
Sabrina


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ