Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-13 Thread Eric W. Biederman
Tetsuo Handa <[EMAIL PROTECTED]> writes: > Hello. > > Andrew Morton wrote: >> I believe (args->nlen > CTL_MAXNAME) was correct. > I'll leave it to you. > But if you want to allow args->nlen == CTL_MAXNAME, > you also need to update do_sysctl(). Which has been that way since before I decided to to

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-12 Thread Tetsuo Handa
Hello. Andrew Morton wrote: > I believe (args->nlen > CTL_MAXNAME) was correct. I'll leave it to you. But if you want to allow args->nlen == CTL_MAXNAME, you also need to update do_sysctl(). int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp, voi

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-12 Thread Andrew Morton
On Tue, 13 Nov 2007 12:07:23 +0900 Tetsuo Handa <[EMAIL PROTECTED]> 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 re

[PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-12 Thread Tetsuo Handa
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 <[EMAIL PROTECTED]> Cc: "Eric W. Bieder

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-12 Thread Tetsuo Handa
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_MAXNA

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-12 Thread Eric W. Biederman
Tetsuo Handa <[EMAIL PROTECTED]> writes: > Hello. > > Thanks for reformatting my patch > and sorry for surprising you with directory name > (I meant to type linux-2.6.24-rc2, not linux-2.6.22-rc2). > > According to linux-2.6.23, > it seems that I should return -ENOTDIR > for invalid args->nlen val

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-08 Thread Tetsuo Handa
Hello. Thanks for reformatting my patch and sorry for surprising you with directory name (I meant to type linux-2.6.24-rc2, not linux-2.6.22-rc2). According to linux-2.6.23, it seems that I should return -ENOTDIR for invalid args->nlen value. I got a question here regarding interpretation of CTL

Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-07 Thread Andrew Morton
> On Thu, 08 Nov 2007 11:57:26 +0900 Tetsuo Handa <[EMAIL PROTECTED]> wrote: > Original patch assumed args->nlen < CTL_MAXNAME, but it can be false. > > Signed-off-by: Tetsuo Handa <[EMAIL PROTECTED]> > > > --- linux-2.6.22-rc2.orig/kernel/sysctl.c 2007-11-08 10:38:17.0 > +0900 > ++

[PATCH] sysctl: Check length at deprecated_sysctl_warning.

2007-11-07 Thread Tetsuo Handa
Original patch assumed args->nlen < CTL_MAXNAME, but it can be false. Signed-off-by: Tetsuo Handa <[EMAIL PROTECTED]> --- linux-2.6.22-rc2.orig/kernel/sysctl.c 2007-11-08 10:38:17.0 +0900 +++ linux-2.6.22-rc2/kernel/sysctl.c2007-11-08 11:24:27.0 +0900 @@ -2609,6 +2609,