[PATCH] sysctl: Scream if someone uses sys_sysctl

From: Eric W. Biederman
Date: Tue Jul 11 2006 - 03:22:37 EST



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@xxxxxxxxxxxx>
---

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

-
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/