Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel/sys.c: Move overflow{uid,gid} sysctl into kernel/sys.c

Moved ctl_tables elements for overflowuid and overflowgid into in
kernel/sys.c. Create a register function that keeps them under "kernel"
and run it after core with postcore_initcall.

This is part of a greater effort to move ctl tables into their
respective subsystems which will reduce the merge conflicts in
kernel/sysctl.c.

Signed-off-by: Joel Granados <joel.granados@kernel.org>

+30 -18
+30
kernel/sys.c
··· 181 181 EXPORT_SYMBOL(fs_overflowuid); 182 182 EXPORT_SYMBOL(fs_overflowgid); 183 183 184 + static const struct ctl_table overflow_sysctl_table[] = { 185 + { 186 + .procname = "overflowuid", 187 + .data = &overflowuid, 188 + .maxlen = sizeof(int), 189 + .mode = 0644, 190 + .proc_handler = proc_dointvec_minmax, 191 + .extra1 = SYSCTL_ZERO, 192 + .extra2 = SYSCTL_MAXOLDUID, 193 + }, 194 + { 195 + .procname = "overflowgid", 196 + .data = &overflowgid, 197 + .maxlen = sizeof(int), 198 + .mode = 0644, 199 + .proc_handler = proc_dointvec_minmax, 200 + .extra1 = SYSCTL_ZERO, 201 + .extra2 = SYSCTL_MAXOLDUID, 202 + }, 203 + }; 204 + 205 + static int __init init_overflow_sysctl(void) 206 + { 207 + register_sysctl_init("kernel", overflow_sysctl_table); 208 + return 0; 209 + } 210 + 211 + postcore_initcall(init_overflow_sysctl); 212 + 213 + 184 214 /* 185 215 * Returns true if current's euid is same as p's uid or euid, 186 216 * or has CAP_SYS_NICE to p's user_ns.
-18
kernel/sysctl.c
··· 1476 1476 }, 1477 1477 #endif 1478 1478 { 1479 - .procname = "overflowuid", 1480 - .data = &overflowuid, 1481 - .maxlen = sizeof(int), 1482 - .mode = 0644, 1483 - .proc_handler = proc_dointvec_minmax, 1484 - .extra1 = SYSCTL_ZERO, 1485 - .extra2 = SYSCTL_MAXOLDUID, 1486 - }, 1487 - { 1488 - .procname = "overflowgid", 1489 - .data = &overflowgid, 1490 - .maxlen = sizeof(int), 1491 - .mode = 0644, 1492 - .proc_handler = proc_dointvec_minmax, 1493 - .extra1 = SYSCTL_ZERO, 1494 - .extra2 = SYSCTL_MAXOLDUID, 1495 - }, 1496 - { 1497 1479 .procname = "ngroups_max", 1498 1480 .data = (void *)&ngroups_max, 1499 1481 .maxlen = sizeof (int),