[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200711122042.HDC69753.LMOOVJFOQHFtFS@I-love.SAKURA.ne.jp>
Date:	Mon, 12 Nov 2007 20:42:41 +0900
From:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:	ebiederm@...ssion.com
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.
Hello.
Eric W. Biederman wrote:
> name[CTL_MAXNAME} is not valid.
> name[0...CTL_MAXNAME-1] is valid.
Yes.
> The check that got lost in the refactoring was specfically:
> 
> -       if (tmp.nlen <= 0 || tmp.nlen >= CTL_MAXNAME)
> -               return -ENOTDIR;
Thus I think tmp.nlen == CTL_MAXNAME should be allowed
because tmp.nlen is used as "for (i = 0; i < tmp.nlen; i++)".
I think
	if (tmp.nlen <= 0 || tmp.nlen > CTL_MAXNAME)
		return -ENOTDIR;
is correct.
Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
