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>] [day] [month] [year] [list]
Date: Wed, 26 Jul 2023 16:06:33 +0200
From: Joel Granados <j.granados@...sung.com>
To: mcgrof@...nel.org, "David S. Miller" <davem@...emloft.net>, Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>
Cc: willy@...radead.org, keescook@...omium.org, josh@...htriplett.org, Joel
	Granados <j.granados@...sung.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 13/14] sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl

This is part of the effort to remove the end element (sentinel) from the
ctl_table arrays. Now that all the callers to register_net_sysctl are
actual arrays, we replace SIZE_MAX with ARRAY_SIZE of the table.

Stopping condition continues to be based on both size and procname null
test. This sets things up for when the sentinel element is actually
removed: Before removing sentinel the stopping criteria will be the last
null element. When the sentinel is removed then the (correct) size will
take over.

Signed-off-by: Joel Granados <j.granados@...sung.com>
---
 include/net/net_namespace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index e4e5fe75a281..75dba309e043 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -470,7 +470,7 @@ void unregister_pernet_device(struct pernet_operations *);
 struct ctl_table;
 
 #define register_net_sysctl(net, path, table)	\
-	register_net_sysctl_sz(net, path, table, SIZE_MAX)
+	register_net_sysctl_sz(net, path, table, ARRAY_SIZE(table))
 #ifdef CONFIG_SYSCTL
 int net_sysctl_init(void);
 struct ctl_table_header *register_net_sysctl_sz(struct net *net, const char *path,
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ