From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [PATCH] Check return from argv_split() in do_coredump().
Date: Fri, 26 Dec 2008 14:45:48 +0000 [thread overview]
Message-ID: <20081226144548.GB3156@hack.private> (raw)
In-Reply-To: <200812240616.mBO6GGEe078727@www262.sakura.ne.jp>
On Wed, Dec 24, 2008 at 03:16:16PM +0900, Tetsuo Handa wrote:
>do_coredump() accesses helper_argv[0] without checking helper_argv != NULL.
>Though, likely helper_argv != NULL.
>
>Below versions have this problem.
>
> 2.6.24.7
> 2.6.25.20
> 2.6.26.8
> 2.6.27.10
> 2.6.28-rc9
> mmotm 2008-12-22-16-14
>
>Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>---
> fs/exec.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>--- linux-2.6.28-rc9-mm1.orig/fs/exec.c
>+++ linux-2.6.28-rc9-mm1/fs/exec.c
>@@ -1809,10 +1809,15 @@ int do_coredump(long signr, int exit_cod
> if ((!ispipe) && (core_limit < binfmt->min_coredump))
> goto fail_unlock;
>
> if (ispipe) {
> helper_argv = argv_split(GFP_KERNEL, corename+1, &helper_argc);
>+ if (!helper_argv) {
>+ printk(KERN_WARNING "%s failed to allocate memory\n",
>+ __func__);
>+ goto fail_unlock;
How about going to the line:
current->fsuid = fsuid;
? Because when argv_split() fails, helper_argv is NULL and doesn't need
to be checked again.
Otherwise,
Reviewed-by: WANG Cong <wangcong@zeuux.org>
Thanks.
--
"Against stupidity, the gods themselves, contend in vain."
next prev parent reply other threads:[~2008-12-26 6:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-24 6:16 [PATCH] Check return from argv_split() in do_coredump() Tetsuo Handa
2008-12-26 14:45 ` Américo Wang [this message]
2008-12-26 7:00 ` Tetsuo Handa
2008-12-26 15:06 ` Américo Wang
2008-12-26 13:20 ` Tetsuo Handa
2008-12-26 13:54 ` KOSAKI Motohiro
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=20081226144548.GB3156@hack.private \
--to=xiyou.wangcong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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