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]
Message-Id: <20230731071728.3493794-4-j.granados@samsung.com>
Date: Mon, 31 Jul 2023 09:17:17 +0200
From: Joel Granados <joel.granados@...il.com>
To: mcgrof@...nel.org
Cc: Catalin Marinas <catalin.marinas@....com>,
	Iurii Zaikin <yzaikin@...gle.com>,
	Jozsef Kadlecsik <kadlec@...filter.org>,
	Sven Schnelle <svens@...ux.ibm.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
	Steffen Klassert <steffen.klassert@...unet.com>,
	Kees Cook <keescook@...omium.org>,
	"D. Wythe" <alibuda@...ux.alibaba.com>,
	mptcp@...ts.linux.dev,
	Jakub Kicinski <kuba@...nel.org>,
	Vasily Gorbik <gor@...ux.ibm.com>,
	Paolo Abeni <pabeni@...hat.com>,
	coreteam@...filter.org,
	Jan Karcher <jaka@...ux.ibm.com>,
	Alexander Aring <alex.aring@...il.com>,
	Will Deacon <will@...nel.org>,
	Stefan Schmidt <stefan@...enfreihafen.org>,
	Matthieu Baerts <matthieu.baerts@...sares.net>,
	bridge@...ts.linux-foundation.org,
	linux-arm-kernel@...ts.infradead.org,
	Joerg Reuter <jreuter@...na.de>,
	Julian Anastasov <ja@....bg>,
	David Ahern <dsahern@...nel.org>,
	netfilter-devel@...r.kernel.org,
	Wen Gu <guwen@...ux.alibaba.com>,
	linux-kernel@...r.kernel.org,
	Santosh Shilimkar <santosh.shilimkar@...cle.com>,
	linux-wpan@...r.kernel.org,
	lvs-devel@...r.kernel.org,
	Karsten Graul <kgraul@...ux.ibm.com>,
	Miquel Raynal <miquel.raynal@...tlin.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	linux-sctp@...r.kernel.org,
	Tony Lu <tonylu@...ux.alibaba.com>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Florian Westphal <fw@...len.de>,
	willy@...radead.org,
	Heiko Carstens <hca@...ux.ibm.com>,
	"David S. Miller" <davem@...emloft.net>,
	linux-rdma@...r.kernel.org,
	Roopa Prabhu <roopa@...dia.com>,
	Alexander Gordeev <agordeev@...ux.ibm.com>,
	Simon Horman <horms@...ge.net.au>,
	Mat Martineau <martineau@...nel.org>,
	josh@...htriplett.org,
	Christian Borntraeger <borntraeger@...ux.ibm.com>,
	Eric Dumazet <edumazet@...gle.com>,
	linux-hams@...r.kernel.org,
	Wenjia Zhang <wenjia@...ux.ibm.com>,
	linux-fsdevel@...r.kernel.org,
	linux-s390@...r.kernel.org,
	Xin Long <lucien.xin@...il.com>,
	Nikolay Aleksandrov <razor@...ckwall.org>,
	netdev@...r.kernel.org,
	rds-devel@....oracle.com,
	Joel Granados <j.granados@...sung.com>
Subject: [PATCH v2 03/14] sysctl: Add ctl_table_size to ctl_table_header

The new ctl_table_size element will hold the size of the ctl_table
arrays contained in the ctl_table_header. This value should eventually
be passed by the callers to the sysctl register infrastructure. And
while this commit introduces the variable, it does not set nor use it
because that requires case by case considerations for each caller.

It provides two important things: (1) A place to put the
result of the ctl_table array calculation when it gets introduced for
each caller. And (2) the size that will be used as the additional
stopping criteria in the list_for_each_table_entry macro (to be added
when all the callers are migrated)

Signed-off-by: Joel Granados <j.granados@...sung.com>
---
 include/linux/sysctl.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 59d451f455bf..33252ad58ebe 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -159,12 +159,22 @@ struct ctl_node {
 	struct ctl_table_header *header;
 };
 
-/* struct ctl_table_header is used to maintain dynamic lists of
-   struct ctl_table trees. */
+/**
+ * struct ctl_table_header - maintains dynamic lists of struct ctl_table trees
+ * @ctl_table: pointer to the first element in ctl_table array
+ * @ctl_table_size: number of elements pointed by @ctl_table
+ * @used: The entry will never be touched when equal to 0.
+ * @count: Upped every time something is added to @inodes and downed every time
+ *         something is removed from inodes
+ * @nreg: When nreg drops to 0 the ctl_table_header will be unregistered.
+ * @rcu: Delays the freeing of the inode. Introduced with "unfuck proc_sysctl ->d_compare()"
+ *
+ */
 struct ctl_table_header {
 	union {
 		struct {
 			struct ctl_table *ctl_table;
+			int ctl_table_size;
 			int used;
 			int count;
 			int nreg;
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ