summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2018-11-08 06:36:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 11:27:44 +0300
commit954ff0468f8bc17baed4673b2458cf8377f0b9ea (patch)
tree3ac5cd5bf6cdb4e67d3cc72294f166c593b71648 /fs
parent27acd8f869ba92e70408168ed2bed504a99b154c (diff)
downloadlinux-954ff0468f8bc17baed4673b2458cf8377f0b9ea.tar.xz
ext4: fix buffer leak in __ext4_read_dirblock() on error path
commit de59fae0043f07de5d25e02ca360f7d57bfa5866 upstream. Fixes: dc6982ff4db1 ("ext4: refactor code to read directory blocks ...") Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.9 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/namei.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index f6a63029b24d..aa08e129149d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -124,6 +124,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
if (!is_dx_block && type == INDEX) {
ext4_error_inode(inode, func, line, block,
"directory leaf block found instead of index block");
+ brelse(bh);
return ERR_PTR(-EFSCORRUPTED);
}
if (!ext4_has_metadata_csum(inode->i_sb) ||