[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240724210509.b3n7eefakigdn2i5@joelS2.panther.com>
Date: Wed, 24 Jul 2024 23:05:09 +0200
From: Joel Granados <j.granados@...sung.com>
To: Kees Cook <kees@...nel.org>
CC: Thomas Weißschuh <linux@...ssschuh.net>, Luis
Chamberlain <mcgrof@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] sysctl: treewide: constify the ctl_table argument of
proc_handlers
On Wed, Jun 19, 2024 at 01:51:15PM -0700, Kees Cook wrote:
> On Wed, Jun 19, 2024 at 12:09:00PM +0200, Thomas Weißschuh wrote:
> > Adapt the proc_hander function signature to make it clear that handlers
> > are not supposed to modify their ctl_table argument.
> >
> > This is also a prerequisite to moving the static ctl_table structs into
> > read-only data.
> >
> > The patch was mostly generated by coccinelle with the following script:
> >
> > @@
> > identifier func, ctl, write, buffer, lenp, ppos;
> > @@
> >
> > int func(
> > - struct ctl_table *ctl,
> > + const struct ctl_table *ctl,
> > int write, void *buffer, size_t *lenp, loff_t *ppos)
> > { ... }
> >
> > In addition to the scripted changes some other changes are done:
> >
> > * The "typedef proc_handler" in include/linux/sysctl.h is changed to use
> > the "const ctl_table".
> >
> > * The prototypes of non-static handlers in header-files are adapted
> > to match the changes of their respective definitions.
> >
> > * kernel/watchdog.c: proc_watchdog_common()
> > This is called from a proc_handler itself and is als calling back
> > into another proc_handler, making it necessary to change it as part
> > of the proc_handler migration.
> >
> > No functional change.
> >
> > Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
>
> This looks good! I'll be glad to see these all be read-only. :)
>
> Reviewed-by: Kees Cook <kees@...nel.org>
Since the patch and the coccinelle script changed, I removed your
Reviewed-by tag from the commit that I sent. Just FYI.
--
Joel Granados
Powered by blists - more mailing lists