From: Linus Torvalds <torvalds@linux-foundation.org>
To: Amerigo Wang <xiyou.wangcong@gmail.com>
Cc: Changli Gao <xiaosuo@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PATCH: fd leak if pipe() is called with an invalid address.
Date: Thu, 9 Jul 2009 20:31:03 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.01.0907092029200.3352@localhost.localdomain> (raw)
In-Reply-To: <20090710031854.GC5694@cr0.nay.redhat.com>
On Fri, 10 Jul 2009, Amerigo Wang wrote:
> On Thu, Jul 02, 2009 at 03:21:55PM +0800, Changli Gao wrote:
> >fd leak if pipe() is called with an invalid address.
> >
> >Though -EFAULT is returned, the file descriptors opened by pipe() call
> >are left open.
> >
> >Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> >----
> >
> > x86/ia32/sys_ia32.c | 5 ++++-
> > xtensa/kernel/syscall.c | 5 ++++-
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
> >
> >--- arch/x86/ia32/sys_ia32.c.orig 2009-07-02 15:08:39.000000000 +0800
> >+++ arch/x86/ia32/sys_ia32.c 2009-07-02 15:09:49.000000000 +0800
>
> This patch is not correctly made... You need to make the patch in the
> _upper_ directory of the top source code tree (if you don't use git),
> so that we can apply it with 'patch -p1 < XXX'.
>
> Probably this is the reason why Linus still doesn't merge it.
No, the main reason I haven't merged it is that I don't think the patch is
worth it.
If you give a bad area to pipe(), there's no point in closign the file
descriptors. It's a user-space bug. You got your file descriptors, you
just don't know what the hell they are, because your program is sh*t.
There's no point in the kernel trying to clean up, because the cleaned-up
state is not any better.
Linus
next prev parent reply other threads:[~2009-07-10 3:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-02 7:21 Changli Gao
2009-07-02 9:12 ` Amerigo Wang
2009-07-10 3:18 ` Amerigo Wang
2009-07-10 3:31 ` Linus Torvalds [this message]
2009-07-10 5:29 ` Amerigo Wang
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=alpine.LFD.2.01.0907092029200.3352@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiaosuo@gmail.com \
--cc=xiyou.wangcong@gmail.com \
/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
Powered by JetHome