From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: akpm@linux-foundation.org
Cc: ebiederm@xmission.com, linux-kernel@vger.kernel.org
Subject: [PATCH] sysctl: Check length at deprecated_sysctl_warning.
Date: Tue, 13 Nov 2007 12:07:23 +0900 [thread overview]
Message-ID: <200711130307.lAD37Nee045340@www262.sakura.ne.jp> (raw)
In-Reply-To: <m14pfr6bnf.fsf@ebiederm.dsl.xmission.com>
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 <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/sysctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff -puN kernel/sysctl.c~sysctl-check-length-at-deprecated_sysctl_warning kernel/sysctl.c
--- a/kernel/sysctl.c~sysctl-check-length-at-deprecated_sysctl_warning
+++ a/kernel/sysctl.c
@@ -2609,6 +2609,10 @@ static int deprecated_sysctl_warning(str
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))
next prev parent reply other threads:[~2007-11-13 3:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-08 2:57 Tetsuo Handa
2007-11-08 3:22 ` Andrew Morton
2007-11-08 8:19 ` Tetsuo Handa
2007-11-12 9:44 ` Eric W. Biederman
2007-11-12 11:42 ` Tetsuo Handa
2007-11-13 3:07 ` Tetsuo Handa [this message]
2007-11-13 3:13 ` Andrew Morton
2007-11-13 3:50 ` Tetsuo Handa
2007-11-13 13:24 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711130307.lAD37Nee045340@www262.sakura.ne.jp \
--to=penguin-kernel@i-love.sakura.ne.jp \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®