aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sysctl.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8bff2c18fb5a..0c8e805bbd6f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2680,13 +2680,33 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
2680asmlinkage long sys_sysctl(struct __sysctl_args __user *args) 2680asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
2681{ 2681{
2682 static int msg_count; 2682 static int msg_count;
2683 struct __sysctl_args tmp;
2684 int name[CTL_MAXNAME];
2685 int i;
2686
2687 /* Read in the sysctl name for better debug message logging */
2688 if (copy_from_user(&tmp, args, sizeof(tmp)))
2689 return -EFAULT;
2690 if (tmp.nlen <= 0 || tmp.nlen >= CTL_MAXNAME)
2691 return -ENOTDIR;
2692 for (i = 0; i < tmp.nlen; i++)
2693 if (get_user(name[i], tmp.name + i))
2694 return -EFAULT;
2695
2696 /* Ignore accesses to kernel.version */
2697 if ((tmp.nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
2698 goto out;
2683 2699
2684 if (msg_count < 5) { 2700 if (msg_count < 5) {
2685 msg_count++; 2701 msg_count++;
2686 printk(KERN_INFO 2702 printk(KERN_INFO
2687 "warning: process `%s' used the removed sysctl " 2703 "warning: process `%s' used the removed sysctl "
2688 "system call\n", current->comm); 2704 "system call with ", current->comm);
2705 for (i = 0; i < tmp.nlen; i++)
2706 printk("%d.", name[i]);
2707 printk("\n");
2689 } 2708 }
2709out:
2690 return -ENOSYS; 2710 return -ENOSYS;
2691} 2711}
2692 2712