[PATCH] sysctl: Scream if someone uses sys_sysctl

Eric W. Biederman
2006-07-11T07:24:27Z

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.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---

Since this patch was trivial I just wipped up this incremental
version. The code compiles is all I know.

kernel/sysctl.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 42610e6..6e7f13a 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1306,6 +1306,11 @@ asmlinkage long sys_sysctl(struct __sysc
struct __sysctl_args tmp;
int error;

+ if (printk_ratelimit())
+ 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;

@@ -2688,6 +2693,10 @@ #else /* CONFIG_SYSCTL_SYSCALL */

asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
{
+ if (printk_ratelimit())
+ printk(KERN_INFO
+ "warning: process `%s' used the removed sysctl "
+ "system call\n", current->comm);
return -ENOSYS;
}

--
1.4.1.gac83a