]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
security: min_addr: move sysctl to security/min_addr.c
authorKaixiong Yu <yukaixiong@huawei.com>
Sat, 11 Jan 2025 07:07:42 +0000 (15:07 +0800)
committerJoel Granados <joel.granados@kernel.org>
Fri, 7 Feb 2025 15:53:04 +0000 (16:53 +0100)
commitb121dd4d557212067275e988137f2e2c5b2c0077
tree6266d606accb25f2ea299baf6a4acac5e5a34005
parentaacdde7202140c8aa4a7a600ad410b11af3b7e4f
security: min_addr: move sysctl to security/min_addr.c

The dac_mmap_min_addr belongs to min_addr.c, move it to
min_addr.c from /kernel/sysctl.c. In the previous Linux kernel
boot process, sysctl_init_bases needs to be executed before
init_mmap_min_addr, So, register_sysctl_init should be executed
before update_mmap_min_addr in init_mmap_min_addr. And according
to the compilation condition in security/Makefile:

      obj-$(CONFIG_MMU)            += min_addr.o

if CONFIG_MMU is not defined, min_addr.c would not be included in the
compilation process. So, drop the CONFIG_MMU check.

Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Paul Moore <paul@paul-moore.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
kernel/sysctl.c
security/min_addr.c