X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fsysctl.c;h=0deed82a61568d6660a7f4ee625c490ffecffcc5;hb=75e7766680b4b196073bdc941b8a6570b9f777af;hp=3a1744fed2b68d589da4cbf4e5f088e652066262;hpb=b82d9fdd848abfbe7263a4ecd9bbb55e575100a6;p=linux-2.6 diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3a1744fed2..0deed82a61 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))