From: Joel Granados <j.granados@samsung.com>
To: Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Kees Cook <keescook@chromium.org>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>, <linux-fsdevel@vger.kernel.org>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH 3/8] sysctl: Remove check for sentinel element in ctl_table arrays
Date: Tue, 4 Jun 2024 08:48:47 +0200 [thread overview]
Message-ID: <20240604064847.4os2h42bj3cg6ptl@joelS2.panther.com> (raw)
In-Reply-To: <20240604-jag-sysctl_remset-v1-3-2df7ecdba0bd@samsung.com>
On Tue, Jun 04, 2024 at 08:29:21AM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados <j.granados@samsung.com>
> --- a/net/sysctl_net.c
> +++ b/net/sysctl_net.c
> @@ -127,7 +127,7 @@ static void ensure_safe_net_sysctl(struct net *net, const char *path,
>
> pr_debug("Registering net sysctl (net %p): %s\n", net, path);
> ent = table;
> - for (size_t i = 0; i < table_size && ent->procname; ent++, i++) {
> + for (size_t i = 0; i < table_size; ent++, i++) {
> unsigned long addr;
> const char *where;
>
> @@ -165,17 +165,10 @@ struct ctl_table_header *register_net_sysctl_sz(struct net *net,
> struct ctl_table *table,
> size_t table_size)
> {
> - int count;
> - struct ctl_table *entry;
> -
> if (!net_eq(net, &init_net))
> ensure_safe_net_sysctl(net, path, table, table_size);
>
> - entry = table;
> - for (count = 0 ; count < table_size && entry->procname; entry++, count++)
> - ;
> -
> - return __register_sysctl_table(&net->sysctls, path, table, count);
> + return __register_sysctl_table(&net->sysctls, path, table, table_size);
> }
> EXPORT_SYMBOL_GPL(register_net_sysctl_sz);
>
Given that this is a very small network related patch, I'm queueing this
in through the sysctl-next branch. Please let me know if you would
rather take it through the networking workflow.
Best
--
Joel Granados
next prev parent reply other threads:[~2024-06-04 6:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 6:29 [PATCH 0/8] sysctl: Remove sentinel check from sysctl internals Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 1/8] locking: Remove superfluous sentinel element from kern_lockdep_table Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 2/8] mm profiling: Remove superfluous sentinel element from ctl_table Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 3/8] sysctl: Remove check for sentinel element in ctl_table arrays Joel Granados via B4 Relay
2024-06-04 6:48 ` Joel Granados [this message]
2024-06-04 6:29 ` [PATCH 4/8] sysctl: Replace nr_entries with ctl_table_size in new_links Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 5/8] sysctl: Remove superfluous empty allocations from sysctl internals Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 6/8] sysctl: Remove "child" sysctl code comments Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 7/8] sysctl: Remove ctl_table sentinel " Joel Granados via B4 Relay
2024-06-04 6:29 ` [PATCH 8/8] sysctl: Warn on an empty procname element Joel Granados via B4 Relay
2024-06-14 13:01 ` Joel Granados
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240604064847.4os2h42bj3cg6ptl@joelS2.panther.com \
--to=j.granados@samsung.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox