Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755051AbbLIJvU (ORCPT ); Wed, 9 Dec 2015 04:51:20 -0500 Received: from mx2.suse.de ([195.135.220.15]:33239 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbbLIJvQ (ORCPT ); Wed, 9 Dec 2015 04:51:16 -0500 Date: Wed, 9 Dec 2015 10:51:13 +0100 From: Jan Kara To: Quentin Casasnovas Cc: lkml , Vegard Nossum , Sasha Levin , Jan Kara Subject: Re: [PATCH] isofs: memory leaks when reading corrupted filesystems. Message-ID: <20151209095113.GB3137@quack.suse.cz> References: <1449335142-6798-1-git-send-email-quentin.casasnovas@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449335142-6798-1-git-send-email-quentin.casasnovas@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1968 Lines: 61 On Sat 05-12-15 18:05:42, Quentin Casasnovas wrote: > Vegard and I found that when a directory on isofs is corrupted, we are not > releasing the associated buffer_head, leading to a memory leak. This was > introduced by: > > 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem") > > This was found by fuzzing. Good catch. Thanks! You can add: Reviewed-by: Jan Kara Honza > Cc: > Cc: Jan Kara > Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading...") > Signed-off-by: Quentin Casasnovas > Signed-off-by: Vegard Nossum > Tested-by: Vegard Nossum > --- > fs/isofs/dir.c | 1 + > fs/isofs/namei.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c > index b943cbd..2e7d74c 100644 > --- a/fs/isofs/dir.c > +++ b/fs/isofs/dir.c > @@ -151,6 +151,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file, > printk(KERN_NOTICE "iso9660: Corrupted directory entry" > " in block %lu of inode %lu\n", block, > inode->i_ino); > + brelse(bh); > return -EIO; > } > > diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c > index 7b543e6..696f255 100644 > --- a/fs/isofs/namei.c > +++ b/fs/isofs/namei.c > @@ -101,6 +101,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, > printk(KERN_NOTICE "iso9660: Corrupted directory entry" > " in block %lu of inode %lu\n", block, > dir->i_ino); > + brelse(bh); > return 0; > } > > -- > 2.4.9 > -- Jan Kara SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/