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

Move from register_net_sysctl to register_net_sysctl_sz and pass the
ARRAY_SIZE of the ctl_table array that was used to create the table
variable. We need to move to the new function in preparation for when we
change SIZE_MAX to ARRAY_SIZE() in the register_net_sysctl macro.
Failing to do so would erroneously allow ARRAY_SIZE() to be called on a
pointer. We hold off the SIZE_MAX to ARRAY_SIZE change until we have
migrated all the relevant net sysctl registering functions to
register_net_sysctl_sz in subsequent commits.

Signed-off-by: Joel Granados <j.granados@...sung.com>
---
 net/ax25/sysctl_net_ax25.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 2154d004d3dc..db66e11e7fe8 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -159,7 +159,8 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev)
 		table[k].data = &ax25_dev->values[k];
 
 	snprintf(path, sizeof(path), "net/ax25/%s", ax25_dev->dev->name);
-	ax25_dev->sysheader = register_net_sysctl(&init_net, path, table);
+	ax25_dev->sysheader = register_net_sysctl_sz(&init_net, path, table,
+						     ARRAY_SIZE(ax25_param_table));
 	if (!ax25_dev->sysheader) {
 		kfree(table);
 		return -ENOMEM;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ