Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6fc48af82cef55546d640778698943b6227b7fb0
Commit:     6fc48af82cef55546d640778698943b6227b7fb0
Parent:     dbd0cf48842700c3a694dcd32b29e63e27f37acc
Author:     Tetsuo Handa <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 14 16:58:38 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Nov 14 18:45:37 2007 -0800

    sysctl: check length at deprecated_sysctl_warning
    
    Original patch assumed args->nlen < CTL_MAXNAME, but it can be false.
    
    Signed-off-by: Tetsuo Handa <[EMAIL PROTECTED]>
    Cc: "Eric W. Biederman" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/sysctl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3a1744f..0deed82 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -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))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to