From: Joel Granados <j.granados@samsung.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Luis Chamberlain <mcgrof@kernel.org>, Kees Cook <kees@kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/6] sysctl: avoid spurious permanent empty tables
Date: Tue, 27 Aug 2024 10:42:02 +0200 [thread overview]
Message-ID: <20240827084202.6a2efzvosdpbc5ll@joelS2.panther.com> (raw)
In-Reply-To: <4baef4a5-6b02-4e2f-870a-810c615a59ce@t-8ch.de>
On Mon, Aug 05, 2024 at 01:51:55PM +0200, Thomas Weißschuh wrote:
> (trimmed recipients to only sysctl maintainers)
>
> Hi Joel,
>
> On 2024-08-05 11:39:35+0000, Thomas Weißschuh wrote:
> > The test if a table is a permanently empty one, inspects the address of
> > the registered ctl_table argument.
> > However as sysctl_mount_point is an empty array and does not occupy and
> > space it can end up sharing an address with another object in memory.
> > If that other object itself is a "struct ctl_table" then registering
> > that table will fail as it's incorrectly recognized as permanently empty.
> >
> > Avoid this issue by adding a dummy element to the array so that is not
> > empty anymore.
> > Explicitly register the table with zero elements as otherwise the dummy
> > element would be recognized as a sentinel element which would lead to a
> > runtime warning from the sysctl core.
> >
> > While the issue seems not being encountered at this time, this seems
> > mostly to be due to luck.
> > Also a future change, constifying sysctl_mount_point and root_table, can
> > reliably trigger this issue on clang 18.
> >
> > Given that empty arrays are non-standard in the first place it seems
> > prudent to avoid them if possible.
>
> Unfortunately I forgot to include the following trailers in this patch:
>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202408051453.f638857e-lkp@intel.com
>
> They will be part of v3 if it comes to that, but if you end up applying
> v2, please do also add those trailers.
>
This is a bugfix and it should be included in the next release. Please send this
commit separately with the Reported-by tag, I'll make sure that this gets pushed
up for 6.11.
I'll add reviewing the rest of the patchset to my "coming back from PTO"
todolist. But since we are so late in the cycle, it might get bumped to the next
release.
Thx
--
Joel Granados
next prev parent reply other threads:[~2024-08-27 9:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 9:39 [PATCH v2 0/6] sysctl: prepare sysctl core for const struct ctl_table Thomas Weißschuh
2024-08-05 9:39 ` [PATCH v2 1/6] sysctl: avoid spurious permanent empty tables Thomas Weißschuh
2024-08-05 11:51 ` Thomas Weißschuh
2024-08-27 8:42 ` Joel Granados [this message]
2024-08-24 18:05 ` Thomas Weißschuh
2024-09-02 9:19 ` Joel Granados
2024-08-05 9:39 ` [PATCH v2 2/6] bpf: Constify ctl_table argument of filter function Thomas Weißschuh
2024-08-05 9:39 ` [PATCH v2 3/6] sysctl: move internal interfaces to const struct ctl_table Thomas Weißschuh
2024-08-05 9:39 ` [PATCH v2 4/6] sysctl: allow registration of " Thomas Weißschuh
2024-08-05 9:39 ` [PATCH v2 5/6] sysctl: make internal ctl_tables const Thomas Weißschuh
2024-08-05 9:39 ` [PATCH v2 6/6] const_structs.checkpatch: add ctl_table Thomas Weißschuh
2024-10-09 11:56 ` [PATCH v2 0/6] sysctl: prepare sysctl core for const struct ctl_table 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=20240827084202.6a2efzvosdpbc5ll@joelS2.panther.com \
--to=j.granados@samsung.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=mcgrof@kernel.org \
/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
all inboxes | Powered by JetHome®