Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: const qualify ctl_tables where applicable #8338

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: treewide: const qualify ctl_tables where applicable
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

Add the const qualifier to all the ctl_tables in the tree except the
ones in ./net dir. The "net" sysctl code is special as it modifies the
arrays before passing it on to the registration function.

Constifying ctl_table structs will prevent the modification of
proc_handler function pointers as the arrays would reside in .rodata.
This is made possible after commit 78eb4ea ("sysctl: treewide:
constify the ctl_table argument of proc_handlers") constified all the
proc_handlers.

Created this by running an spatch followed by a sed command:
Spatch:
    virtual patch

    @
    depends on !(file in "net")
    disable optional_qualifier
    @
    identifier table_name;
    @@

    + const
    struct ctl_table table_name [] = { ... };

sed:
    sed --in-place \
      -e "s/struct ctl_table .table = &uts_kern/const struct ctl_table *table = \&uts_kern/" \
      kernel/utsname_sysctl.c

Signed-off-by: Joel Granados <[email protected]>
Acked-by: Steven Rostedt (Google) <[email protected]> # for kernel/trace/
Acked-by: Jani Nikula <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]> # SCSI
Acked-by: Corey Minyard <[email protected]>
Reviewed-by: "Darrick J. Wong" <[email protected]> # xfs
Reviewed-by: Song Liu <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e8ec1c9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=923743
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=923743 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/923743=>bpf-next branch January 9, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant