Skip to content

Commit

Permalink
isofs: release buffer head before return
Browse files Browse the repository at this point in the history
Release the buffer_head before returning error code in
do_isofs_readdir() and isofs_find_entry().

Fixes: 2deb1ac ("isofs: fix access to unallocated memory when reading corrupted filesystem")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Pan Bian <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
SinkFinder authored and jankara committed Jan 25, 2021
1 parent a4db107 commit 0a6dc67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/isofs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions fs/isofs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0a6dc67

Please sign in to comment.