summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2021-01-18 15:04:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-03 19:44:37 +0300
commitef89b3861774b1f560915b9560b03158f9817392 (patch)
tree9d61da4419ddabb8eed719666ffdb8e0ec3d425c /fs
parente0ce3009ed614c3f91d28311a0758cf76e48a680 (diff)
downloadlinux-ef89b3861774b1f560915b9560b03158f9817392.tar.xz
isofs: release buffer head before return
[ Upstream commit 0a6dc67a6aa45f19bd4ff89b4f468fc50c4b8daa ] Release the buffer_head before returning error code in do_isofs_readdir() and isofs_find_entry(). Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem") Link: https://lore.kernel.org/r/20210118120455.118955-1-bianpan2016@163.com Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/isofs/dir.c1
-rw-r--r--fs/isofs/namei.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index e7599615e4e0..e876a30f9073 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 aee592767f1d..2c43de1b034d 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;
}