Skip to contentSkip to conversation

isofs: release buffer head before return

PATCH In review Pan Bian 2 participants 3 messages Jan 18, 2021 – Jan 25, 2021 Isofs filesystem

lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 isofs: release buffer head before return

Release the buffer header before returning error code.

Fixes 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")
---
 fs/isofs/dir.c | 1 +
 1 file changed, 1 insertion(+)
fs/isofs/dir.c +1 -0
index f0fe641893a5..b9e6a7ec78be 100644
@@ -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;
 		}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 4 lines · Pan Bian

Release the buffer header before returning error code.

Fixes 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")

OK, good spotting. But the other hunk in commit 2deb1acc653c seems to have the same problem so we might fix it as well when we are at it?

Honza

Quoted 19 lines
---
 fs/isofs/dir.c | 1 +
 1 file changed, 1 insertion(+)
fs/isofs/dir.c +1 -0
index f0fe641893a5..b9e6a7ec78be 100644
@@ -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;
 		}
 
Signature · 1 line
2.17.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
maintainer
#2 lore raw
Quoted 8 lines · Jan Kara
Quoted 4 lines · Pan Bian

Release the buffer header before returning error code.

Fixes 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")

OK, good spotting. But the other hunk in commit 2deb1acc653c seems to have the same problem so we might fix it as well when we are at it?

OK, I did this myself and picked the patch to my tree.

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR