The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sysctl: Check length at deprecated_sysctl_warning.
@ 2007-11-08  2:57 Tetsuo Handa
  2007-11-08  3:22 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Tetsuo Handa @ 2007-11-08  2:57 UTC (permalink / raw)
  To: akpm; +Cc: ebiederm, linux-kernel

Original patch assumed args->nlen < CTL_MAXNAME, but it can be false.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>


--- linux-2.6.22-rc2.orig/kernel/sysctl.c	2007-11-08 10:38:17.000000000 +0900
+++ linux-2.6.22-rc2/kernel/sysctl.c	2007-11-08 11:24:27.000000000 +0900
@@ -2609,6 +2609,10 @@ static int deprecated_sysctl_warning(str
 	int name[CTL_MAXNAME];
 	int i;
 
+	/* Check args->nlen. */
+	if (args->nlen > CTL_MAXNAME)
+		return -EFAULT;
+
 	/* Read in the sysctl name for better debug message logging */
 	for (i = 0; i < args->nlen; i++)
 		if (get_user(name[i], args->name + i))

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-13 13:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08  2:57 [PATCH] sysctl: Check length at deprecated_sysctl_warning Tetsuo Handa
2007-11-08  3:22 ` Andrew Morton
2007-11-08  8:19   ` Tetsuo Handa
2007-11-12  9:44     ` Eric W. Biederman
2007-11-12 11:42       ` Tetsuo Handa
2007-11-13  3:07       ` Tetsuo Handa
2007-11-13  3:13         ` Andrew Morton
2007-11-13  3:50           ` Tetsuo Handa
2007-11-13 13:24             ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox