lkml.org 
[lkml]   [2007]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysctl: Check length at deprecated_sysctl_warning.
On Tue, 13 Nov 2007 12:07:23 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:

> Andrew, please replace previous patch with this one.
> This one returns -ENOTDIR.
> ----------
>
> Original patch forgot to check args->nlen.
> I don't know why args->nlen == CTL_MAXNAME is rejected,
> but it has been rejected traditionally.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/sysctl.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff -puN kernel/sysctl.c~sysctl-check-length-at-deprecated_sysctl_warning kernel/sysctl.c
> --- a/kernel/sysctl.c~sysctl-check-length-at-deprecated_sysctl_warning
> +++ a/kernel/sysctl.c
> @@ -2609,6 +2609,10 @@ static int deprecated_sysctl_warning(str
> int name[CTL_MAXNAME];
> int i;
>
> + /* Check args->nlen. */
> + if (args->nlen <= 0 || args->nlen >= CTL_MAXNAME)

I believe (args->nlen > CTL_MAXNAME) was correct.

> + return -ENOTDIR;

Ho hum. Why does that code return -ENOTDIR on error anyway?

> +
> /* 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))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-13 04:15    [W:0.045 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site