sysctl changes for v6.10-rc1

Summary
 * Removed sentinel elements from ctl_table structs in kernel/*
 
   Removing sentinels in ctl_table arrays reduces the build time size and
   runtime memory consumed by ~64 bytes per array. Removals for net/, io_uring/,
   mm/, ipc/ and security/ are set to go into mainline through their respective
   subsystems making the next release the most likely place where the final
   series that removes the check for proc_name == NULL will land. This PR adds
   to removals already in arch/, drivers/ and fs/.
 
 * Adjusted ctl_table definitions and references to allow constification
 
   Adjustments:
     - Removing unused ctl_table function arguments
     - Moving non-const elements from ctl_table to ctl_table_header
     - Making ctl_table pointers const in ctl_table_root structure
 
   Making the static ctl_table structs const will increase safety by keeping the
   pointers to proc_handler functions in .rodata. Though no ctl_tables where
   made const in this PR, the ground work for making that possible has started
   with these changes sent by Thomas Weißschuh.
 
 Testing
 * These changes went into linux-next after v6.9-rc4; giving it a good month of
   testing.
 -----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEErkcJVyXmMSXOyyeQupfNUreWQU8FAmZFvBMACgkQupfNUreW
 QU/eGAv9EWeiXKxr3EVSMAsb9MWbJq7C99I/pd5hMf+qH4PgJpKDH7w/sb2e8h8+
 unGiW83ikgrtph7OS4/xM3Y9r3Nvzd6C/OztqgMnNKeRFdMgP7wu9HaSNs05ordb
 CqJdhvL93quc5HxrGTS9sdLK/wLJWOHwuWMXhX4qS44JNxTdPV2q10Rb7DZyHZ6O
 C9qp61L2Q2CrnOBKIx8MoeCh20ynJQAo3b0pTN63ZYF4D0vqCcnYNNTPkge4ID8/
 ULJoP5hAQY0vJ4g4fC4Gmooa5GECpm8MfZUf3SdgPyauqM/sm3dVdsLXAWD4Phcp
 TsG2a/5KMYwnLHrUGwDW7bFfEemRU88h0Iam56+SKMl1kMlEpWaLL9ApQXoHFayG
 e10izS+i/nlQiqYIHtuczCoTimT4/LGnonCLcdA//C3XzBT5MnOd7xsjuaQSpFWl
 /CV9SZa4ABwzX7u2jty8ik90iihLCFQyKj1d9m1mDVbgb6r3iUOxVuHBgMtY7MF7
 eyaEmV7l
 =/rQW
 -----END PGP SIGNATURE-----

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

Pull sysctl updates from Joel Granados:

 - Remove sentinel elements from ctl_table structs in kernel/*

   Removing sentinels in ctl_table arrays reduces the build time size
   and runtime memory consumed by ~64 bytes per array. Removals for
   net/, io_uring/, mm/, ipc/ and security/ are set to go into mainline
   through their respective subsystems making the next release the most
   likely place where the final series that removes the check for
   proc_name == NULL will land.

   This adds to removals already in arch/, drivers/ and fs/.

 - Adjust ctl_table definitions and references to allow constification
     - Remove unused ctl_table function arguments
     - Move non-const elements from ctl_table to ctl_table_header
     - Make ctl_table pointers const in ctl_table_root structure

   Making the static ctl_table structs const will increase safety by
   keeping the pointers to proc_handler functions in .rodata. Though no
   ctl_tables where made const in this PR, the ground work for making
   that possible has started with these changes sent by Thomas
   Weißschuh.

* tag 'sysctl-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
  sysctl: drop now unnecessary out-of-bounds check
  sysctl: move sysctl type to ctl_table_header
  sysctl: drop sysctl_is_perm_empty_ctl_table
  sysctl: treewide: constify argument ctl_table_root::permissions(table)
  sysctl: treewide: drop unused argument ctl_table_root::set_ownership(table)
  bpf: Remove the now superfluous sentinel elements from ctl_table array
  delayacct: Remove the now superfluous sentinel elements from ctl_table array
  kprobes: Remove the now superfluous sentinel elements from ctl_table array
  printk: Remove the now superfluous sentinel elements from ctl_table array
  scheduler: Remove the now superfluous sentinel elements from ctl_table array
  seccomp: Remove the now superfluous sentinel elements from ctl_table array
  timekeeping: Remove the now superfluous sentinel elements from ctl_table array
  ftrace: Remove the now superfluous sentinel elements from ctl_table array
  umh: Remove the now superfluous sentinel elements from ctl_table array
  kernel misc: Remove the now superfluous sentinel elements from ctl_table array
This commit is contained in:
Linus Torvalds 2024-05-17 17:31:24 -07:00
commit 91b6163be4
35 changed files with 28 additions and 67 deletions

View File

@ -30,9 +30,7 @@ static const struct file_operations proc_sys_dir_file_operations;
static const struct inode_operations proc_sys_dir_operations; static const struct inode_operations proc_sys_dir_operations;
/* Support for permanently empty directories */ /* Support for permanently empty directories */
static struct ctl_table sysctl_mount_point[] = { static struct ctl_table sysctl_mount_point[] = { };
{.type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY }
};
/** /**
* register_sysctl_mount_point() - registers a sysctl mount point * register_sysctl_mount_point() - registers a sysctl mount point
@ -48,14 +46,12 @@ struct ctl_table_header *register_sysctl_mount_point(const char *path)
} }
EXPORT_SYMBOL(register_sysctl_mount_point); EXPORT_SYMBOL(register_sysctl_mount_point);
#define sysctl_is_perm_empty_ctl_table(tptr) \
(tptr[0].type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY)
#define sysctl_is_perm_empty_ctl_header(hptr) \ #define sysctl_is_perm_empty_ctl_header(hptr) \
(sysctl_is_perm_empty_ctl_table(hptr->ctl_table)) (hptr->type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY)
#define sysctl_set_perm_empty_ctl_header(hptr) \ #define sysctl_set_perm_empty_ctl_header(hptr) \
(hptr->ctl_table[0].type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) (hptr->type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY)
#define sysctl_clear_perm_empty_ctl_header(hptr) \ #define sysctl_clear_perm_empty_ctl_header(hptr) \
(hptr->ctl_table[0].type = SYSCTL_TABLE_TYPE_DEFAULT) (hptr->type = SYSCTL_TABLE_TYPE_DEFAULT)
void proc_sys_poll_notify(struct ctl_table_poll *poll) void proc_sys_poll_notify(struct ctl_table_poll *poll)
{ {
@ -210,6 +206,8 @@ static void init_header(struct ctl_table_header *head,
node++; node++;
} }
} }
if (table == sysctl_mount_point)
sysctl_set_perm_empty_ctl_header(head);
} }
static void erase_header(struct ctl_table_header *head) static void erase_header(struct ctl_table_header *head)
@ -232,8 +230,7 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header)
return -EROFS; return -EROFS;
/* Am I creating a permanently empty directory? */ /* Am I creating a permanently empty directory? */
if (header->ctl_table_size > 0 && if (sysctl_is_perm_empty_ctl_header(header)) {
sysctl_is_perm_empty_ctl_table(header->ctl_table)) {
if (!RB_EMPTY_ROOT(&dir->root)) if (!RB_EMPTY_ROOT(&dir->root))
return -EINVAL; return -EINVAL;
sysctl_set_perm_empty_ctl_header(dir_h); sysctl_set_perm_empty_ctl_header(dir_h);
@ -480,7 +477,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
} }
if (root->set_ownership) if (root->set_ownership)
root->set_ownership(head, table, &inode->i_uid, &inode->i_gid); root->set_ownership(head, &inode->i_uid, &inode->i_gid);
else { else {
inode->i_uid = GLOBAL_ROOT_UID; inode->i_uid = GLOBAL_ROOT_UID;
inode->i_gid = GLOBAL_ROOT_GID; inode->i_gid = GLOBAL_ROOT_GID;
@ -1204,7 +1201,7 @@ static bool get_links(struct ctl_dir *dir,
struct ctl_table *entry, *link; struct ctl_table *entry, *link;
if (header->ctl_table_size == 0 || if (header->ctl_table_size == 0 ||
sysctl_is_perm_empty_ctl_table(header->ctl_table)) sysctl_is_perm_empty_ctl_header(header))
return true; return true;
/* Are there links available for every entry in table? */ /* Are there links available for every entry in table? */

View File

@ -137,17 +137,6 @@ struct ctl_table {
void *data; void *data;
int maxlen; int maxlen;
umode_t mode; umode_t mode;
/**
* enum type - Enumeration to differentiate between ctl target types
* @SYSCTL_TABLE_TYPE_DEFAULT: ctl target with no special considerations
* @SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY: Used to identify a permanently
* empty directory target to serve
* as mount point.
*/
enum {
SYSCTL_TABLE_TYPE_DEFAULT,
SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY
} type;
proc_handler *proc_handler; /* Callback for text formatting */ proc_handler *proc_handler; /* Callback for text formatting */
struct ctl_table_poll *poll; struct ctl_table_poll *poll;
void *extra1; void *extra1;
@ -188,6 +177,17 @@ struct ctl_table_header {
struct ctl_dir *parent; struct ctl_dir *parent;
struct ctl_node *node; struct ctl_node *node;
struct hlist_head inodes; /* head for proc_inode->sysctl_inodes */ struct hlist_head inodes; /* head for proc_inode->sysctl_inodes */
/**
* enum type - Enumeration to differentiate between ctl target types
* @SYSCTL_TABLE_TYPE_DEFAULT: ctl target with no special considerations
* @SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY: Used to identify a permanently
* empty directory target to serve
* as mount point.
*/
enum {
SYSCTL_TABLE_TYPE_DEFAULT,
SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY,
} type;
}; };
struct ctl_dir { struct ctl_dir {
@ -205,9 +205,8 @@ struct ctl_table_root {
struct ctl_table_set default_set; struct ctl_table_set default_set;
struct ctl_table_set *(*lookup)(struct ctl_table_root *root); struct ctl_table_set *(*lookup)(struct ctl_table_root *root);
void (*set_ownership)(struct ctl_table_header *head, void (*set_ownership)(struct ctl_table_header *head,
struct ctl_table *table,
kuid_t *uid, kgid_t *gid); kuid_t *uid, kgid_t *gid);
int (*permissions)(struct ctl_table_header *head, struct ctl_table *table); int (*permissions)(struct ctl_table_header *head, const struct ctl_table *table);
}; };
#define register_sysctl(path, table) \ #define register_sysctl(path, table) \

View File

@ -192,7 +192,6 @@ static int set_is_seen(struct ctl_table_set *set)
} }
static void ipc_set_ownership(struct ctl_table_header *head, static void ipc_set_ownership(struct ctl_table_header *head,
struct ctl_table *table,
kuid_t *uid, kgid_t *gid) kuid_t *uid, kgid_t *gid)
{ {
struct ipc_namespace *ns = struct ipc_namespace *ns =
@ -205,7 +204,7 @@ static void ipc_set_ownership(struct ctl_table_header *head,
*gid = gid_valid(ns_root_gid) ? ns_root_gid : GLOBAL_ROOT_GID; *gid = gid_valid(ns_root_gid) ? ns_root_gid : GLOBAL_ROOT_GID;
} }
static int ipc_permissions(struct ctl_table_header *head, struct ctl_table *table) static int ipc_permissions(struct ctl_table_header *head, const struct ctl_table *table)
{ {
int mode = table->mode; int mode = table->mode;
@ -224,7 +223,7 @@ static int ipc_permissions(struct ctl_table_header *head, struct ctl_table *tabl
kuid_t ns_root_uid; kuid_t ns_root_uid;
kgid_t ns_root_gid; kgid_t ns_root_gid;
ipc_set_ownership(head, table, &ns_root_uid, &ns_root_gid); ipc_set_ownership(head, &ns_root_uid, &ns_root_gid);
if (uid_eq(current_euid(), ns_root_uid)) if (uid_eq(current_euid(), ns_root_uid))
mode >>= 6; mode >>= 6;

View File

@ -78,7 +78,6 @@ static int set_is_seen(struct ctl_table_set *set)
} }
static void mq_set_ownership(struct ctl_table_header *head, static void mq_set_ownership(struct ctl_table_header *head,
struct ctl_table *table,
kuid_t *uid, kgid_t *gid) kuid_t *uid, kgid_t *gid)
{ {
struct ipc_namespace *ns = struct ipc_namespace *ns =
@ -91,13 +90,13 @@ static void mq_set_ownership(struct ctl_table_header *head,
*gid = gid_valid(ns_root_gid) ? ns_root_gid : GLOBAL_ROOT_GID; *gid = gid_valid(ns_root_gid) ? ns_root_gid : GLOBAL_ROOT_GID;
} }
static int mq_permissions(struct ctl_table_header *head, struct ctl_table *table) static int mq_permissions(struct ctl_table_header *head, const struct ctl_table *table)
{ {
int mode = table->mode; int mode = table->mode;
kuid_t ns_root_uid; kuid_t ns_root_uid;
kgid_t ns_root_gid; kgid_t ns_root_gid;
mq_set_ownership(head, table, &ns_root_uid, &ns_root_gid); mq_set_ownership(head, &ns_root_uid, &ns_root_gid);
if (uid_eq(current_euid(), ns_root_uid)) if (uid_eq(current_euid(), ns_root_uid))
mode >>= 6; mode >>= 6;

View File

@ -84,7 +84,6 @@ static struct ctl_table kern_acct_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ }
}; };
static __init int kernel_acct_sysctls_init(void) static __init int kernel_acct_sysctls_init(void)

View File

@ -6035,7 +6035,6 @@ static struct ctl_table bpf_syscall_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = bpf_stats_handler, .proc_handler = bpf_stats_handler,
}, },
{ }
}; };
static int __init bpf_syscall_sysctl_init(void) static int __init bpf_syscall_sysctl_init(void)

View File

@ -74,7 +74,6 @@ static struct ctl_table kern_delayacct_table[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{ }
}; };
static __init int kernel_delayacct_sysctls_init(void) static __init int kernel_delayacct_sysctls_init(void)

View File

@ -94,7 +94,6 @@ static struct ctl_table kern_exit_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_douintvec, .proc_handler = proc_douintvec,
}, },
{ }
}; };
static __init int kernel_exit_sysctls_init(void) static __init int kernel_exit_sysctls_init(void)

View File

@ -314,7 +314,6 @@ static struct ctl_table hung_task_sysctls[] = {
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_NEG_ONE, .extra1 = SYSCTL_NEG_ONE,
}, },
{}
}; };
static void __init hung_task_sysctl_init(void) static void __init hung_task_sysctl_init(void)

View File

@ -948,7 +948,6 @@ static struct ctl_table kexec_core_sysctls[] = {
.mode = 0644, .mode = 0644,
.proc_handler = kexec_limit_handler, .proc_handler = kexec_limit_handler,
}, },
{ }
}; };
static int __init kexec_core_sysctl_init(void) static int __init kexec_core_sysctl_init(void)

View File

@ -968,7 +968,6 @@ static struct ctl_table kprobe_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static void __init kprobe_sysctls_init(void) static void __init kprobe_sysctls_init(void)

View File

@ -85,7 +85,6 @@ static struct ctl_table latencytop_sysctl[] = {
.mode = 0644, .mode = 0644,
.proc_handler = sysctl_latencytop, .proc_handler = sysctl_latencytop,
}, },
{}
}; };
#endif #endif

View File

@ -100,7 +100,6 @@ static struct ctl_table kern_panic_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_douintvec, .proc_handler = proc_douintvec,
}, },
{ }
}; };
static __init int kernel_panic_sysctls_init(void) static __init int kernel_panic_sysctls_init(void)

View File

@ -307,7 +307,6 @@ static struct ctl_table pid_ns_ctl_table[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &pid_max, .extra2 = &pid_max,
}, },
{ }
}; };
#endif /* CONFIG_CHECKPOINT_RESTORE */ #endif /* CONFIG_CHECKPOINT_RESTORE */

View File

@ -41,7 +41,6 @@ static struct ctl_table pid_ns_ctl_table_vm[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO, .extra2 = SYSCTL_TWO,
}, },
{ }
}; };
static inline void register_pid_ns_sysctl_table_vm(void) static inline void register_pid_ns_sysctl_table_vm(void)
{ {

View File

@ -76,7 +76,6 @@ static struct ctl_table printk_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO, .extra2 = SYSCTL_TWO,
}, },
{}
}; };
void __init printk_sysctl_init(void) void __init printk_sysctl_init(void)

View File

@ -1295,7 +1295,6 @@ static struct ctl_table kern_reboot_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ }
}; };
static void __init kernel_reboot_sysctls_init(void) static void __init kernel_reboot_sysctls_init(void)

View File

@ -19,7 +19,6 @@ static struct ctl_table sched_autogroup_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static void __init sched_autogroup_sysctl_init(void) static void __init sched_autogroup_sysctl_init(void)

View File

@ -4741,7 +4741,6 @@ static struct ctl_table sched_core_sysctls[] = {
.extra2 = SYSCTL_FOUR, .extra2 = SYSCTL_FOUR,
}, },
#endif /* CONFIG_NUMA_BALANCING */ #endif /* CONFIG_NUMA_BALANCING */
{}
}; };
static int __init sched_core_sysctl_init(void) static int __init sched_core_sysctl_init(void)
{ {

View File

@ -43,7 +43,6 @@ static struct ctl_table sched_dl_sysctls[] = {
.proc_handler = proc_douintvec_minmax, .proc_handler = proc_douintvec_minmax,
.extra2 = (void *)&sysctl_sched_dl_period_max, .extra2 = (void *)&sysctl_sched_dl_period_max,
}, },
{}
}; };
static int __init sched_dl_sysctl_init(void) static int __init sched_dl_sysctl_init(void)

View File

@ -151,7 +151,6 @@ static struct ctl_table sched_fair_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
}, },
#endif /* CONFIG_NUMA_BALANCING */ #endif /* CONFIG_NUMA_BALANCING */
{}
}; };
static int __init sched_fair_sysctl_init(void) static int __init sched_fair_sysctl_init(void)

View File

@ -56,7 +56,6 @@ static struct ctl_table sched_rt_sysctls[] = {
.mode = 0644, .mode = 0644,
.proc_handler = sched_rr_handler, .proc_handler = sched_rr_handler,
}, },
{}
}; };
static int __init sched_rt_sysctl_init(void) static int __init sched_rt_sysctl_init(void)

View File

@ -322,7 +322,6 @@ static struct ctl_table sched_energy_aware_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static int __init sched_energy_aware_sysctl_init(void) static int __init sched_energy_aware_sysctl_init(void)

View File

@ -2445,7 +2445,6 @@ static struct ctl_table seccomp_sysctl_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = seccomp_actions_logged_handler, .proc_handler = seccomp_actions_logged_handler,
}, },
{ }
}; };
static int __init seccomp_sysctl_init(void) static int __init seccomp_sysctl_init(void)

View File

@ -4840,7 +4840,6 @@ static struct ctl_table signal_debug_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
#endif #endif
{ }
}; };
static int __init init_signal_sysctls(void) static int __init init_signal_sysctls(void)

View File

@ -54,7 +54,6 @@ static struct ctl_table stackleak_sysctls[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static int __init stackleak_sysctls_init(void) static int __init stackleak_sysctls_init(void)

View File

@ -2034,7 +2034,6 @@ static struct ctl_table kern_table[] = {
.extra2 = SYSCTL_INT_MAX, .extra2 = SYSCTL_INT_MAX,
}, },
#endif #endif
{ }
}; };
static struct ctl_table vm_table[] = { static struct ctl_table vm_table[] = {
@ -2240,7 +2239,6 @@ static struct ctl_table vm_table[] = {
.extra2 = (void *)&mmap_rnd_compat_bits_max, .extra2 = (void *)&mmap_rnd_compat_bits_max,
}, },
#endif #endif
{ }
}; };
int __init sysctl_init_bases(void) int __init sysctl_init_bases(void)

View File

@ -312,7 +312,6 @@ static struct ctl_table timer_sysctl[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static int __init timer_sysctl_init(void) static int __init timer_sysctl_init(void)

View File

@ -8269,7 +8269,6 @@ static struct ctl_table ftrace_sysctls[] = {
.mode = 0644, .mode = 0644,
.proc_handler = ftrace_enable_sysctl, .proc_handler = ftrace_enable_sysctl,
}, },
{}
}; };
static int __init ftrace_sysctl_init(void) static int __init ftrace_sysctl_init(void)

View File

@ -2833,7 +2833,6 @@ static struct ctl_table user_event_sysctls[] = {
.mode = 0644, .mode = 0644,
.proc_handler = set_max_user_events_sysctl, .proc_handler = set_max_user_events_sysctl,
}, },
{}
}; };
static int __init trace_events_user_init(void) static int __init trace_events_user_init(void)

View File

@ -38,7 +38,7 @@ static int set_is_seen(struct ctl_table_set *set)
} }
static int set_permissions(struct ctl_table_header *head, static int set_permissions(struct ctl_table_header *head,
struct ctl_table *table) const struct ctl_table *table)
{ {
struct user_namespace *user_ns = struct user_namespace *user_ns =
container_of(head->set, struct user_namespace, set); container_of(head->set, struct user_namespace, set);
@ -87,7 +87,6 @@ static struct ctl_table user_table[] = {
UCOUNT_ENTRY("max_fanotify_groups"), UCOUNT_ENTRY("max_fanotify_groups"),
UCOUNT_ENTRY("max_fanotify_marks"), UCOUNT_ENTRY("max_fanotify_marks"),
#endif #endif
{ }
}; };
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
@ -96,7 +95,7 @@ bool setup_userns_sysctls(struct user_namespace *ns)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
struct ctl_table *tbl; struct ctl_table *tbl;
BUILD_BUG_ON(ARRAY_SIZE(user_table) != UCOUNT_COUNTS + 1); BUILD_BUG_ON(ARRAY_SIZE(user_table) != UCOUNT_COUNTS);
setup_sysctl_set(&ns->set, &set_root, set_is_seen); setup_sysctl_set(&ns->set, &set_root, set_is_seen);
tbl = kmemdup(user_table, sizeof(user_table), GFP_KERNEL); tbl = kmemdup(user_table, sizeof(user_table), GFP_KERNEL);
if (tbl) { if (tbl) {

View File

@ -560,7 +560,6 @@ static struct ctl_table usermodehelper_table[] = {
.mode = 0600, .mode = 0600,
.proc_handler = proc_cap_handler, .proc_handler = proc_cap_handler,
}, },
{ }
}; };
static int __init init_umh_sysctls(void) static int __init init_umh_sysctls(void)

View File

@ -120,7 +120,6 @@ static struct ctl_table uts_kern_table[] = {
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.poll = &domainname_poll, .poll = &domainname_poll,
}, },
{}
}; };
#ifdef CONFIG_PROC_SYSCTL #ifdef CONFIG_PROC_SYSCTL

View File

@ -1155,7 +1155,6 @@ static struct ctl_table watchdog_sysctls[] = {
}, },
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#endif #endif
{}
}; };
static struct ctl_table watchdog_hardlockup_sysctl[] = { static struct ctl_table watchdog_hardlockup_sysctl[] = {
@ -1168,7 +1167,6 @@ static struct ctl_table watchdog_hardlockup_sysctl[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
}, },
{}
}; };
static void __init watchdog_sysctl_init(void) static void __init watchdog_sysctl_init(void)

View File

@ -40,7 +40,7 @@ static int is_seen(struct ctl_table_set *set)
/* Return standard mode bits for table entry. */ /* Return standard mode bits for table entry. */
static int net_ctl_permissions(struct ctl_table_header *head, static int net_ctl_permissions(struct ctl_table_header *head,
struct ctl_table *table) const struct ctl_table *table)
{ {
struct net *net = container_of(head->set, struct net, sysctls); struct net *net = container_of(head->set, struct net, sysctls);
@ -54,7 +54,6 @@ static int net_ctl_permissions(struct ctl_table_header *head,
} }
static void net_ctl_set_ownership(struct ctl_table_header *head, static void net_ctl_set_ownership(struct ctl_table_header *head,
struct ctl_table *table,
kuid_t *uid, kgid_t *gid) kuid_t *uid, kgid_t *gid)
{ {
struct net *net = container_of(head->set, struct net, sysctls); struct net *net = container_of(head->set, struct net, sysctls);