Re: [PATCH] sysctl: Allow /proc/sys without sys_sysctl

From: Andrew Morton
Date: Tue Jul 11 2006 - 04:04:12 EST


On Tue, 11 Jul 2006 01:52:57 -0600
ebiederm@xxxxxxxxxxxx (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@xxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/