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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230809105006.1198165-13-j.granados@samsung.com>
Date:   Wed,  9 Aug 2023 12:50:04 +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 12/14] vrf: 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. The actual change from SIZE_MAX to ARRAY_SIZE will take place
in subsequent commits.

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

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 6043e63b42f9..6801f15ac609 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1979,7 +1979,8 @@ static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf)
 	/* init the extra1 parameter with the reference to current netns */
 	table[0].extra1 = net;
 
-	nn_vrf->ctl_hdr = register_net_sysctl(net, "net/vrf", table);
+	nn_vrf->ctl_hdr = register_net_sysctl_sz(net, "net/vrf", table,
+						 ARRAY_SIZE(vrf_table));
 	if (!nn_vrf->ctl_hdr) {
 		kfree(table);
 		return -ENOMEM;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ