lkml.org 
[lkml]   [2006]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysctl: Allow /proc/sys without sys_sysctl
On Tue, 11 Jul 2006 01:52:57 -0600
ebiederm@xmission.com (Eric W. Biederman) wrote:

> As far as I can tell we never use sys_sysctl so I never expect to see
> these messages. But if we do see these it means that there are user
> space applications that need to be fixed before we can safely
> remove sys_sysctl.
>
> Limited to only 5 messages in case something like glibc is using sys_sysctl.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> ---
> kernel/sysctl.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 42610e6..b7f7dcb 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1303,9 +1303,15 @@ int do_sysctl(int __user *name, int nlen
>
> asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
> {
> + static int msg_count;
> struct __sysctl_args tmp;
> int error;
>
> + if (msg_count++ < 5)
> + printk(KERN_INFO
> + "warning: process `%s' used the obsolete sysctl "
> + "system call\n", current->comm);
> +
> if (copy_from_user(&tmp, args, sizeof(tmp)))
> return -EFAULT;

That'll print it five times per 4 billion calls ;)

> @@ -2688,6 +2694,12 @@ #else /* CONFIG_SYSCTL_SYSCALL */
>
> asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
> {
> + static int msg_count;
> +
> + if (msg_coutn++ < 5)

That'll have trouble compiling.

Go to bed, man. I'll fix it up.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-11 10:09    [W:1.187 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site