lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240620103451.7c4oznlkwty53bzs@joelS2.panther.com>
Date: Thu, 20 Jun 2024 12:34:51 +0200
From: Joel Granados <j.granados@...sung.com>
To: Thomas Weißschuh <linux@...ssschuh.net>
CC: Luis Chamberlain <mcgrof@...nel.org>, Kees Cook <kees@...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 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>
Will test this in 0-day in [1] to avoid potential conflicts with all the
other stuff going into linux-next and because it does not apply cleanly to
sysctl-next. Don't expect any issues from 0-day as it is a
non-functional trivial change.

I'll use this patch as is when the time comes during the end of the
merge window (at that point it should apply cleanly) and go into 

@Thomas: Can I ping you during the merge window to double check that
there are no additional proc_handlers (without the const argument)
that might not be present in today's linux-next?

Best

[1] https://git.kernel.org/pub/scm/linux/kernel/git/joel.granados/linux.git/log/?h=jag/constify_proc_handlers

-- 

Joel Granados

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ