mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
sysctl: check length at deprecated_sysctl_warning
Original patch assumed args->nlen < CTL_MAXNAME, but it can be false. 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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
dbd0cf4884
commit
6fc48af82c
1 changed files with 4 additions and 0 deletions
|
@ -2620,6 +2620,10 @@ static int deprecated_sysctl_warning(struct __sysctl_args *args)
|
|||
int name[CTL_MAXNAME];
|
||||
int i;
|
||||
|
||||
/* Check args->nlen. */
|
||||
if (args->nlen < 0 || args->nlen > CTL_MAXNAME)
|
||||
return -ENOTDIR;
|
||||
|
||||
/* 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))
|
||||
|
|
Loading…
Reference in a new issue