Commit 592329e5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sysctl updates from Joel Granados:

 - Move vm_table members out of kernel/sysctl.c

   All vm_table array members have moved to their respective subsystems
   leading to the removal of vm_table from kernel/sysctl.c. This
   increases modularity by placing the ctl_tables closer to where they
   are actually used and at the same time reducing the chances of merge
   conflicts in kernel/sysctl.c.

 - ctl_table range fixes

   Replace the proc_handler function that checks variable ranges in
   coredump_sysctls and vdso_table with the one that actually uses the
   extra{1,2} pointers as min/max values. This tightens the range of the
   values that users can pass into the kernel effectively preventing
   {under,over}flows.

 - Misc fixes

   Correct grammar errors and typos in test messages. Update sysctl
   files in MAINTAINERS. Constified and removed array size in
   declaration for alignment_tbl

* tag 'sysctl-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl: (22 commits)
  selftests/sysctl: fix wording of help messages
  selftests: fix spelling/grammar errors in sysctl/sysctl.sh
  MAINTAINERS: Update sysctl file list in MAINTAINERS
  sysctl: Fix underflow value setting risk in vm_table
  coredump: Fixes core_pipe_limit sysctl proc_handler
  sysctl: remove unneeded include
  sysctl: remove the vm_table
  sh: vdso: move the sysctl to arch/sh/kernel/vsyscall/vsyscall.c
  x86: vdso: move the sysctl to arch/x86/entry/vdso/vdso32-setup.c
  fs: dcache: move the sysctl to fs/dcache.c
  sunrpc: simplify rpcauth_cache_shrink_count()
  fs: drop_caches: move sysctl to fs/drop_caches.c
  fs: fs-writeback: move sysctl to fs/fs-writeback.c
  mm: nommu: move sysctl to mm/nommu.c
  security: min_addr: move sysctl to security/min_addr.c
  mm: mmap: move sysctl to mm/mmap.c
  mm: util: move sysctls to mm/util.c
  mm: vmscan: move vmscan sysctls to mm/vmscan.c
  mm: swap: move sysctl to mm/swap.c
  mm: filemap: move sysctl to mm/filemap.c
  ...
parents 336b4dae 29fa7d79
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -19081,9 +19081,10 @@ S: Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl-next
F:	fs/proc/proc_sysctl.c
F:	include/linux/sysctl.h
F:	kernel/sysctl-test.c
F:	kernel/sysctl.c
F:	tools/testing/selftests/sysctl/
F:	kernel/sysctl*
F:	tools/testing/selftests/sysctl/*
F:	lib/test_sysctl.c
F:	scripts/check-sysctl-docs
PS3 NETWORK SUPPORT
M:	Geoff Levand <geoff@infradead.org>
+1 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ void csky_alignment(struct pt_regs *regs)
	force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)addr);
}

static struct ctl_table alignment_tbl[5] = {
static const struct ctl_table alignment_tbl[] = {
	{
		.procname = "kernel_enable",
		.data = &align_kern_enable,
+21 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <linux/module.h>
#include <linux/elf.h>
#include <linux/sched.h>
#include <linux/sysctl.h>
#include <linux/err.h>

/*
@@ -30,6 +31,18 @@ static int __init vdso_setup(char *s)
}
__setup("vdso=", vdso_setup);

static const struct ctl_table vdso_table[] = {
	{
		.procname	= "vdso_enabled",
		.data		= &vdso_enabled,
		.maxlen		= sizeof(vdso_enabled),
		.mode		= 0644,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= SYSCTL_ZERO,
		.extra2		= SYSCTL_ONE,
	},
};

/*
 * These symbols are defined by vsyscall.o to mark the bounds
 * of the ELF DSO images included therein.
@@ -58,6 +71,14 @@ int __init vsyscall_init(void)
	return 0;
}

static int __init vm_sysctl_init(void)
{
       register_sysctl_init("vm", vdso_table);
       return 0;
}

fs_initcall(vm_sysctl_init);

/* Setup a VMA at program startup for the vsyscall page */
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
{
+11 −5
Original line number Diff line number Diff line
@@ -51,15 +51,17 @@ __setup("vdso32=", vdso32_setup);
__setup_param("vdso=", vdso_setup, vdso32_setup, 0);
#endif

#ifdef CONFIG_X86_64

#ifdef CONFIG_SYSCTL
/* Register vsyscall32 into the ABI table */
#include <linux/sysctl.h>

static const struct ctl_table abi_table2[] = {
static const struct ctl_table vdso_table[] = {
	{
#ifdef CONFIG_X86_64
		.procname	= "vsyscall32",
#else
		.procname	= "vdso_enabled",
#endif
		.data		= &vdso32_enabled,
		.maxlen		= sizeof(int),
		.mode		= 0644,
@@ -71,10 +73,14 @@ static const struct ctl_table abi_table2[] = {

static __init int ia32_binfmt_init(void)
{
	register_sysctl("abi", abi_table2);
#ifdef CONFIG_X86_64
	/* Register vsyscall32 into the ABI table */
	register_sysctl("abi", vdso_table);
#else
	register_sysctl_init("vm", vdso_table);
#endif
	return 0;
}
__initcall(ia32_binfmt_init);
#endif /* CONFIG_SYSCTL */
#endif	/* CONFIG_X86_64 */
+3 −1
Original line number Diff line number Diff line
@@ -1042,7 +1042,9 @@ static const struct ctl_table coredump_sysctls[] = {
		.data		= &core_pipe_limit,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
		.proc_handler	= proc_dointvec_minmax,
		.extra1		= SYSCTL_ZERO,
		.extra2		= SYSCTL_INT_MAX,
	},
	{
		.procname       = "core_file_note_size_limit",
Loading