mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sysctl: Allow /proc/sys without sys_sysctl
Date: Tue, 11 Jul 2006 01:05:48 -0700	[thread overview]
Message-ID: <20060711010548.b6e4138e.akpm@osdl.org> (raw)
In-Reply-To: <m14pxoh92e.fsf@ebiederm.dsl.xmission.com>

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.


  reply	other threads:[~2006-07-11  8:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10 22:38 Eric W. Biederman
2006-07-10 22:48 ` Randy.Dunlap
2006-07-11  4:00   ` Eric W. Biederman
2006-07-11  4:19 ` Andrew Morton
2006-07-11  6:57   ` Eric W. Biederman
2006-07-11  7:04     ` Andrew Morton
2006-07-11  7:52       ` Eric W. Biederman
2006-07-11  8:05         ` Andrew Morton [this message]
2006-07-11  7:23   ` [PATCH] sysctl: Scream if someone uses sys_sysctl Eric W. Biederman
2006-07-11 22:26 ` [PATCH] sysctl: Allow /proc/sys without sys_sysctl Andi Kleen
2006-07-12  3:13   ` Eric W. Biederman
2006-07-12 13:32     ` Andi Kleen
2006-07-12 14:47       ` Eric W. Biederman
2006-07-12 14:52         ` Andi Kleen
2006-07-12 15:32           ` Eric W. Biederman
2006-07-12 16:08             ` Andi Kleen
2006-07-12 16:36               ` Eric W. Biederman
2006-07-12 18:24                 ` Stephen Hemminger
2006-07-12 19:58                   ` Arjan van de Ven
2006-07-13  0:52                     ` Theodore Tso
2006-07-14 20:09                       ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060711010548.b6e4138e.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®