VisionFive2 Linux kernel

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

More than 9999 Commits   32 Branches   54 Tags
author: Zeng Heng <zengheng4@huawei.com> 2022-12-08 00:28:07 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:46 +0200 commit: 721b75ea2dfce53a8890dff92ae01afca8e74f88 parent: 84996061793a60447abc77d310a5566101af7747
Commit Summary:
ntfs: Fix panic about slab-out-of-bounds caused by ntfs_listxattr()
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index c3de60a4543f..fd02fcf4d409 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -214,6 +214,9 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,
 		ea = Add2Ptr(ea_all, off);
 		ea_size = unpacked_ea_size(ea);
 
+		if (!ea->name_len)
+			break;
+
 		if (buffer) {
 			if (ret + ea->name_len + 1 > bytes_per_buffer) {
 				err = -ERANGE;