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.

mm: move randomize_va_space into memory.c

Move the randomize_va_space variable together with all its sysctl table
elements into memory.c. Register it to the "kernel" directory by
adding it to the subsys initialization calls

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.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>

+18 -9
-9
kernel/sysctl.c
··· 1688 1688 .proc_handler = proc_dointvec, 1689 1689 }, 1690 1690 #endif 1691 - #if defined(CONFIG_MMU) 1692 - { 1693 - .procname = "randomize_va_space", 1694 - .data = &randomize_va_space, 1695 - .maxlen = sizeof(int), 1696 - .mode = 0644, 1697 - .proc_handler = proc_dointvec, 1698 - }, 1699 - #endif 1700 1691 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN 1701 1692 { 1702 1693 .procname = "ignore-unaligned-usertrap",
+18
mm/memory.c
··· 125 125 2; 126 126 #endif 127 127 128 + static const struct ctl_table mmu_sysctl_table[] = { 129 + { 130 + .procname = "randomize_va_space", 131 + .data = &randomize_va_space, 132 + .maxlen = sizeof(int), 133 + .mode = 0644, 134 + .proc_handler = proc_dointvec, 135 + }, 136 + }; 137 + 138 + static int __init init_mm_sysctl(void) 139 + { 140 + register_sysctl_init("kernel", mmu_sysctl_table); 141 + return 0; 142 + } 143 + 144 + subsys_initcall(init_mm_sysctl); 145 + 128 146 #ifndef arch_wants_old_prefaulted_pte 129 147 static inline bool arch_wants_old_prefaulted_pte(void) 130 148 {