mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joel Granados <j.granados@samsung.com>
To: Kees Cook <kees@kernel.org>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sysctl: treewide: constify the ctl_table argument of proc_handlers
Date: Wed, 24 Jul 2024 23:05:09 +0200	[thread overview]
Message-ID: <20240724210509.b3n7eefakigdn2i5@joelS2.panther.com> (raw)
In-Reply-To: <202406191350.BB98FF1@keescook>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 1609 bytes --]

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@weissschuh.net>
> 
> This looks good! I'll be glad to see these all be read-only. :)
> 
> Reviewed-by: Kees Cook <kees@kernel.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

  reply	other threads:[~2024-07-24 21:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240619100941eucas1p25d522dca3b74c899434b97b0c0dc78a0@eucas1p2.samsung.com>
2024-06-19 10:09 ` Thomas Weißschuh
2024-06-19 20:51   ` Kees Cook
2024-07-24 21:05     ` Joel Granados [this message]
2024-07-24 21:29       ` Kees Cook
2024-06-20  8:22   ` Joel Granados
2024-06-20 10:34   ` Joel Granados
2024-06-20 14:34     ` Thomas Weißschuh
2024-06-20 23:45   ` Luis Chamberlain
2024-07-15 20:23   ` Joel Granados
2024-07-15 20:58     ` Thomas Weißschuh
2024-07-16 15:27       ` Joel Granados
2024-07-17 15:26         ` Thomas Weißschuh
2024-07-17 19:57           ` Joel Granados
2024-07-22  7:41             ` Thomas Weißschuh
2024-07-23  8:33               ` Joel Granados
2024-07-24  8:41               ` Joel Granados
2024-07-24  8:56                 ` Thomas Weißschuh
2024-07-24  9:18                   ` Joel Granados
2024-07-24  9:32                     ` Thomas Weißschuh
2024-07-24 18:20                       ` Joel Granados
2024-07-24 18:43                         ` Thomas Weißschuh

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=20240724210509.b3n7eefakigdn2i5@joelS2.panther.com \
    --to=j.granados@samsung.com \
    --cc=akpm@linux-foundation.org \
    --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®