Commit af13ff1c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'constfy-sysctl-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl

Pull sysctl table constification from Joel Granados:
 "All ctl_table declared outside of functions and that remain unmodified
  after initialization are const qualified.

  This prevents unintended modifications to proc_handler function
  pointers by placing them in the .rodata section.

  This is a continuation of the tree-wide effort started a few releases
  ago with the constification of the ctl_table struct arguments in the
  sysctl API done in 78eb4ea2 ("sysctl: treewide: constify the
  ctl_table argument of proc_handlers")"

* tag 'constfy-sysctl-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
  treewide: const qualify ctl_tables where applicable
parents 92cc9acf 1751f872
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

static unsigned int isa_membase, isa_portbase, isa_portshift;

static struct ctl_table ctl_isa_vars[] = {
static const struct ctl_table ctl_isa_vars[] = {
	{
		.procname	= "membase",
		.data		= &isa_membase, 
+2 −2
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ static int vec_proc_do_default_vl(const struct ctl_table *table, int write,
	return 0;
}

static struct ctl_table sve_default_vl_table[] = {
static const struct ctl_table sve_default_vl_table[] = {
	{
		.procname	= "sve_default_vector_length",
		.mode		= 0644,
@@ -585,7 +585,7 @@ static int __init sve_sysctl_init(void) { return 0; }
#endif /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */

#if defined(CONFIG_ARM64_SME) && defined(CONFIG_SYSCTL)
static struct ctl_table sme_default_vl_table[] = {
static const struct ctl_table sme_default_vl_table[] = {
	{
		.procname	= "sme_default_vector_length",
		.mode		= 0644,
+1 −1
Original line number Diff line number Diff line
@@ -859,7 +859,7 @@ long get_tagged_addr_ctrl(struct task_struct *task)
 * disable it for tasks that already opted in to the relaxed ABI.
 */

static struct ctl_table tagged_addr_sysctl_table[] = {
static const struct ctl_table tagged_addr_sysctl_table[] = {
	{
		.procname	= "tagged_addr_disabled",
		.mode		= 0644,
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ void power4_idle(void)
/*
 * Register the sysctl to set/clear powersave_nap.
 */
static struct ctl_table powersave_nap_ctl_table[] = {
static const struct ctl_table powersave_nap_ctl_table[] = {
	{
		.procname	= "powersave-nap",
		.data		= &powersave_nap,
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ struct update_props_workarea {
static unsigned int nmi_wd_lpm_factor = 200;

#ifdef CONFIG_SYSCTL
static struct ctl_table nmi_wd_lpm_factor_ctl_table[] = {
static const struct ctl_table nmi_wd_lpm_factor_ctl_table[] = {
	{
		.procname	= "nmi_wd_lpm_factor",
		.data		= &nmi_wd_lpm_factor,
Loading