Skip to content
Commit 93bda330 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-constify-ctl_table-arguments-of-utility-functions'

Thomas Weißschuh says:

====================
net: constify ctl_table arguments of utility functions

The sysctl core is preparing to only expose instances of
struct ctl_table as "const".
This will also affect the ctl_table argument of sysctl handlers.

As the function prototype of all sysctl handlers throughout the tree
needs to stay consistent that change will be done in one commit.

To reduce the size of that final commit, switch utility functions which
are not bound by "typedef proc_handler" to "const struct ctl_table".

No functional change.

This patch(set) is meant to be applied through your subsystem tree.
Or at your preference through the sysctl tree.

Motivation
==========

Moving structures containing function pointers into unmodifiable .rodata
prevents attackers or bugs from corrupting and diverting those pointers.

Also the "struct ctl_table" exposed by the sysctl core were never meant
to be mutated by users.

For this goal changes to both the sysctl core and "const" qualifiers for
various sysctl APIs are necessary.
====================

Link: https://lore.kernel.org/r/20240527-sysctl-const-handler-net-v1-0-16523767d0b2@weissschuh.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 982300c1 0a9f788f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment