public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: devel@openvz.org
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: Re: [PATCH] struct file leakage
Date: Mon, 10 Jul 2006 05:56:07 -0600	[thread overview]
Message-ID: <m1odvxptbb.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <44B2185F.1060402@sw.ru> (Kirill Korotaev's message of "Mon, 10 Jul 2006 13:05:35 +0400")

Kirill Korotaev <dev@sw.ru> writes:

> Hello!
>
> Andrew, this is a patch from Alexey Kuznetsov for 2.6.16.
> I believe 2.6.17 still has this leak.
>
> -------------------------------------------------------------
>
> 2.6.16 leaks like hell. While testing, I found massive leakage
> (reproduced in openvz) in:
>
> *filp
> *size-4096
>
> And 1 object leaks in
> *size-32
> *size-64
> *size-128
>
>
> It is the fix for the first one. filp leaks in the bowels
> of namei.c.
>
> Seems, size-4096 is file table leaking in expand_fdtables.
>
> I have no idea what are the rest and why they show only
> accompaniing another leaks. Some debugging structs?

Or something the intent or the filp holds a reference to?

Looks like this has been broken since 834f2a4a1554dc5b2598038b3fe8703defcbe467
about 9 months ago.

The patch looks sane.

Trond did you just miss this case?


> Signed-Off-By: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: Kirill Korotaev <dev@openvz.org>
>
> --- linux-2.6.16-w/fs/namei.c	2006-07-10 11:43:11.000000000 +0400
> +++ linux-2.6.16/fs/namei.c	2006-07-10 11:53:36.000000000 +0400
> @@ -1774,8 +1774,15 @@ do_link:
>  	if (error)
>  		goto exit_dput;
>  	error = __do_follow_link(&path, nd);
> -	if (error)
> +	if (error) {
> +		/* Does someone understand code flow here? Or it is only
> +		 * me so stupid? Anathema to whoever designed this non-sense
> +		 * with "intent.open".
> +		 */
> +		if (!IS_ERR(nd->intent.open.file))
> +			release_open_intent(nd);
>  		return error;
> +	}
>  	nd->flags &= ~LOOKUP_PARENT;
>  	if (nd->last_type == LAST_BIND)
>  		goto ok;

Eric

  parent reply	other threads:[~2006-07-10 11:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10  9:05 [PATCH] struct file leakage Kirill Korotaev
2006-07-10 10:05 ` Andrew Morton
2006-07-10 10:16   ` Alexey Kuznetsov
2006-07-11 12:04   ` Trond Myklebust
2006-07-11 23:32     ` Andrew Morton
2006-07-12  0:26       ` Trond Myklebust
2006-07-10 11:56 ` Eric W. Biederman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-10  9:05 Kirill Korotaev

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=m1odvxptbb.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@osdl.org \
    --cc=devel@openvz.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --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