The patch titled sysctl: implement sysctl_uts_string() has been added to the -mm tree. Its filename is sysctl-implement-sysctl_uts_string.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: sysctl: implement sysctl_uts_string() From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> The problem: When using sys_sysctl we don't read the proper values for the variables exported from the uts namespace, nor do we do the proper locking. This patch introduces sysctl_uts_string which properly fetches the values and does the proper locking. Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/sysctl.c | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff -puN kernel/sysctl.c~sysctl-implement-sysctl_uts_string kernel/sysctl.c --- a/kernel/sysctl.c~sysctl-implement-sysctl_uts_string +++ a/kernel/sysctl.c @@ -137,6 +137,10 @@ static int parse_table(int __user *, int static int proc_do_uts_string(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos); +static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context); + #ifdef CONFIG_PROC_SYSCTL static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos); @@ -258,7 +262,7 @@ static ctl_table kern_table[] = { .maxlen = sizeof(init_uts_ns.name.sysname), .mode = 0444, .proc_handler = &proc_do_uts_string, - .strategy = &sysctl_string, + .strategy = &sysctl_uts_string, }, { .ctl_name = KERN_OSRELEASE, @@ -267,7 +271,7 @@ static ctl_table kern_table[] = { .maxlen = sizeof(init_uts_ns.name.release), .mode = 0444, .proc_handler = &proc_do_uts_string, - .strategy = &sysctl_string, + .strategy = &sysctl_uts_string, }, { .ctl_name = KERN_VERSION, @@ -276,7 +280,7 @@ static ctl_table kern_table[] = { .maxlen = sizeof(init_uts_ns.name.version), .mode = 0444, .proc_handler = &proc_do_uts_string, - .strategy = &sysctl_string, + .strategy = &sysctl_uts_string, }, { .ctl_name = KERN_NODENAME, @@ -285,7 +289,7 @@ static ctl_table kern_table[] = { .maxlen = sizeof(init_uts_ns.name.nodename), .mode = 0644, .proc_handler = &proc_do_uts_string, - .strategy = &sysctl_string, + .strategy = &sysctl_uts_string, }, { .ctl_name = KERN_DOMAINNAME, @@ -294,7 +298,7 @@ static ctl_table kern_table[] = { .maxlen = sizeof(init_uts_ns.name.domainname), .mode = 0644, .proc_handler = &proc_do_uts_string, - .strategy = &sysctl_string, + .strategy = &sysctl_uts_string, }, { .ctl_name = KERN_PANIC, @@ -2600,6 +2604,23 @@ int sysctl_ms_jiffies(ctl_table *table, return 1; } + +/* The generic string strategy routine: */ +static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context) +{ + struct ctl_table uts_table; + int r, write; + write = newval && newlen; + memcpy(&uts_table, table, sizeof(uts_table)); + uts_table.data = get_uts(table, write); + r = sysctl_string(&uts_table, name, nlen, + oldval, oldlenp, newval, newlen, context); + put_uts(table, write, uts_table.data); + return r; +} + #else /* CONFIG_SYSCTL_SYSCALL */ @@ -2664,6 +2685,12 @@ int sysctl_ms_jiffies(ctl_table *table, return -ENOSYS; } +static int sysctl_uts_string(ctl_table *table, int __user *name, int nlen, + void __user *oldval, size_t __user *oldlenp, + void __user *newval, size_t newlen, void **context) +{ + return -ENOSYS; +} #endif /* CONFIG_SYSCTL_SYSCALL */ /* _ Patches currently in -mm which might be from ebiederm@xxxxxxxxxxxx are origin.patch x86-64-calling-clear_bss-before-set_intr_gate-with-early_idt_handler.patch x86-64-change-the-size-for-interrupt-array-to-nr_vectors.patch make-fs-proc-basecproc_pid_instantiate-static.patch add-process_session-helper-routine.patch rename-struct-namespace-to-struct-mnt_namespace.patch add-an-identifier-to-nsproxy.patch rename-struct-pspace-to-struct-pid_namespace.patch add-pid_namespace-to-nsproxy.patch use-current-nsproxy-pid_ns.patch add-child-reaper-to-pid_namespace.patch sysctl-simplify-sysctl_uts_string.patch sysctl-implement-sysctl_uts_string.patch sysctl-simplify-ipc-ns-specific-sysctls.patch sysctl-fix-sys_sysctl-interface-of-ipc-sysctls.patch updated-i386-cleanup-apic-code.patch updated-i386-rework-local-apic-calibration.patch updated-dynticks-fix-nmi-watchdog.patch clockevents-core-check-for-clock-event-device-handler-being-non-null-before-calling-it.patch pidhash-temporary-debug-checks.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html