Re: Current state of the sysctl constification effort

From: Kees Cook
Date: Thu Jun 06 2024 - 14:52:34 EST


On Wed, Jun 05, 2024 at 10:26:25AM +0200, Joel Granados wrote:
> On Fri, May 31, 2024 at 09:31:24AM -0700, Kees Cook wrote:
> > On Fri, May 31, 2024 at 12:50:32PM +0200, Thomas Wei?schuh wrote:
> > > Hi Joel, Hi Luis,
> > >
> > > most of the sysctl handler preparation patches have been picked up by
> > > the subsystem maintainers and are available in -next.
> > >
> > > Only two are missing:
> > >
> > > * utsname: constify ctl_table arguments of utility function [0]
> > > * sysctl: constify ctl_table arguments of utility function [1]
> > >
> > > Both of them are going through the sysctl tree anyways.
> >
> > This is great! Is the target v6.11 or v6.10 for these?
> >
> > -Kees
> >
> > > With this done it should be possible to also queue up
> > > sysctl: treewide: constify the ctl_table argument of handlers [2]
> > > for the bots to chew on in -next.
> @kees: Since you have probably done these before, I'll ask you the
> questions:
>
> 1. The idea is to send Linus the treewide-constify patch on its own at
> the end of the merge window for 6.11. Right?

Right. The best time is likely around Wed on the second week of the merge
window, assuming all dependencies have landed. And it could be sent
earlier if all the dependencies land sooner than that.

> 2. Is there a special way to send these treewide patches? Or is it just
> a regular PR with an explanation on why it is being done?

I would do a regular PR with all the details for Linus to do the change
himself, but many times people send these as an explicit patch. For
example, include the full Coccinelle script, or the "sed" command
line, etc, and then detail any "by hand" changes that were needed on
top of that.

> 3. Can you please send (if there are any) me any examples where this has
> been done in the past. Maybe some lore.kernel.org links?

I found this one that is a good example, though it's a PATCH not a GIT PULL:

https://lore.kernel.org/lkml/20221220134519.3dd1318b@xxxxxxxxxxxxxxxxxx/
became
https://git.kernel.org/linus/292a089d78d3e2f7944e60bb897c977785a321e3

-Kees

--
Kees Cook