VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Simon Gander <simon@tuxera.com> 2020-04-10 14:32:16 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2020-04-10 15:36:20 -0700 commit: 25efb2ffdf991177e740b2f63e92b4ec7d310a92 parent: c0cc271173b2e1c2d8d0ceaef14e4dfa79eefc0d
Commit Summary:
hfsplus: fix crash and filesystem corruption when deleting files
Diffstat:
1 file changed, 4 insertions, 0 deletions
diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c
index e6d554476db4..eeebe80c6be4 100644
--- a/fs/hfsplus/attributes.c
+++ b/fs/hfsplus/attributes.c
@@ -292,6 +292,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid,
 		return -ENOENT;
 	}
 
+	/* Avoid btree corruption */
+	hfs_bnode_read(fd->bnode, fd->search_key,
+			fd->keyoffset, fd->keylength);
+
 	err = hfs_brec_remove(fd);
 	if (err)
 		return err;