]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
isofs: release buffer head before return
authorPan Bian <bianpan2016@163.com>
Mon, 18 Jan 2021 12:04:55 +0000 (04:04 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:31 +0000 (18:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1918974
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/isofs/dir.c
fs/isofs/namei.c

index f0fe641893a5e5ea720e035b28f48cc382b51819..b9e6a7ec78be42dac08e7c77e188ca6bb78f4ffc 100644 (file)
@@ -152,6 +152,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;
                }
 
index cac468f04820e9669b1f59ba9632c420b52b2bce..558e7c51ce0d4b99771f53ef2feb38954eb348ae 100644 (file)
@@ -102,6 +102,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;
                }