lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.00.1101101557400.21100@tigran.mtv.corp.google.com>
Date:	Mon, 10 Jan 2011 16:02:11 -0800 (PST)
From:	Hugh Dickins <hughd@...gle.com>
To:	"Theodore Ts'o" <tytso@....edu>
cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>,
	stable@...nel.org
Subject: Re: [PATCH] ext4: fix memory leak in ext4_free_branches

On Mon, 10 Jan 2011, Theodore Ts'o wrote:

> Commit 40389687 moved a call to ext4_forget() out of
> ext4_free_branches and let ext4_free_blocks() handle calling
> bforget().  But that change unfortunately did not replace the call to
> ext4_forget() with brelse(), which was needed to drop the in-use count
> of the indirect block's buffer head, which lead to a memory leak when
> deleting files that used indirect blocks.  Fix this.
> 
> Thanks to Hugh Dickins for pointing this out.
> 
> Cc: stable@...nel.org
> Signed-off-by: "Theodore Ts'o" <tytso@....edu>

Many thanks: I've given that a run with the added debug I'd put in,
and it fixes the problems nicely.  I thought it would be a brelse(bh)
somewhere, but wouldn't dare trust my data to my own guesses of where!

Hugh

> ---
>  fs/ext4/inode.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 84b6162..e80fc51 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4378,6 +4378,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
>  					(__le32 *) bh->b_data,
>  					(__le32 *) bh->b_data + addr_per_block,
>  					depth);
> +			brelse(bh);
>  
>  			/*
>  			 * Everything below this this pointer has been
> -- 
> 1.7.3.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ