aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-11-06 02:52:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-06 04:46:23 -0500
commit0e009be8a0c2309f3696df70f72ef0075aa34c9c (patch)
treec5bb299c54ec1334dd934f06ad5b6caa2880b5dd /kernel
parent64efade11cddc4237c1b95ea4ca18af122a7e19e (diff)
[PATCH] Improve the removed sysctl warnings
Don't warn about libpthread's access to kernel.version. When it receives -ENOSYS it will read /proc/sys/kernel/version. If anything else shows up print the sysctl number string. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Cal Peake <cp@absolutedigital.net> Cc: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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