sysctl: Warn about all uses of sys_sysctl.
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 12 Nov 2009 03:32:48 +0000 (19:32 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 12 Nov 2009 03:35:52 +0000 (19:35 -0800)
Now that the glibc pthread implemenation no longers uses sysctl() users
of sysctl are as rare as hen's teeth.  So remove the glibc exception
from the warning, and use the standard printk_ratelimit instead of
rolling our own.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
kernel/sysctl_binary.c

index 471438bbece63ffa81d22aae60ef7d955abeab09..bf0a4b06782a81e458d93313eee5173344d0c38a 100644 (file)
@@ -1393,15 +1393,9 @@ static ssize_t binary_sysctl(const int *name, int nlen,
 
 static void deprecated_sysctl_warning(const int *name, int nlen)
 {
-       static int msg_count;
        int i;
 
-       /* Ignore accesses to kernel.version */
-       if ((nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
-               return;
-
-       if (msg_count < 5) {
-               msg_count++;
+       if (printk_ratelimit()) {
                printk(KERN_INFO
                        "warning: process `%s' used the deprecated sysctl "
                        "system call with ", current->comm);