提交 4ad0a2aa 编写于 作者: P Pan Bian 提交者: Cheng Jian

isofs: release buffer head before return

stable inclusion
from linux-4.19.178
commit 8e51a6f8cf9c2a6e8e7b321a7fbccf6108b9e50c

--------------------------------

[ Upstream commit 0a6dc67a ]

Release the buffer_head before returning error code in
do_isofs_readdir() and isofs_find_entry().

Fixes: 2deb1acc ("isofs: fix access to unallocated memory when reading corrupted filesystem")
Link: https://lore.kernel.org/r/20210118120455.118955-1-bianpan2016@163.comSigned-off-by: NPan Bian <bianpan2016@163.com>
Signed-off-by: NJan Kara <jack@suse.cz>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 44bb4490
...@@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file, ...@@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
printk(KERN_NOTICE "iso9660: Corrupted directory entry" printk(KERN_NOTICE "iso9660: Corrupted directory entry"
" in block %lu of inode %lu\n", block, " in block %lu of inode %lu\n", block,
inode->i_ino); inode->i_ino);
brelse(bh);
return -EIO; return -EIO;
} }
......
...@@ -102,6 +102,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, ...@@ -102,6 +102,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
printk(KERN_NOTICE "iso9660: Corrupted directory entry" printk(KERN_NOTICE "iso9660: Corrupted directory entry"
" in block %lu of inode %lu\n", block, " in block %lu of inode %lu\n", block,
dir->i_ino); dir->i_ino);
brelse(bh);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册