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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tetsuo Handa <penguin-kernel@...>
Cc: Andrew Morton <akpm@...>, <ebiederm@...>, <linux-kernel@...>
Date: Tuesday, November 13, 2007 - 9:24 am

Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> writes:


Which has been that way since before I decided to touch it. 2.6.12-rc1.
I haven't tracked it before then as I don't expect to see anything.

And that is why -ENOTDIR.  That is the historical error code from sysctl in
this case.


CTL_MAXNAME is fairly arbitrary, and since the set of binary paths is fixed.
So it feels to me like the code really should read:

        if (nlen <= 0 || nlen > CTL_MAXNAME)
                return -ENOTDIR;

In both places. Just because that is what the comment describes.

I think in reality CTL_MAXNAME is actually 5 but I would have to look a little
more closely to confirm that.

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning., Eric W. Biederman, (Mon Nov 12, 5:44 am)
Re: [PATCH] sysctl: Check length at deprecated_sysctl_warning., Eric W. Biederman, (Tue Nov 13, 9:24 am)