Skip to content

Commit 731ab1f

Browse files
ea1davisaalexandrovich
authored andcommitted
fs/ntfs3: Fix oob in ntfs_listxattr
The length of name cannot exceed the space occupied by ea. Reported-and-tested-by: syzbot+65e940cfb8f99a97aca7@syzkaller.appspotmail.com Signed-off-by: Edward Adam Davis <eadavis@qq.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent b2dd7b9 commit 731ab1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ntfs3/xattr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,
219219
if (!ea->name_len)
220220
break;
221221

222+
if (ea->name_len > ea_size)
223+
break;
224+
222225
if (buffer) {
223226
/* Check if we can use field ea->name */
224227
if (off + ea_size > size)

0 commit comments

Comments
 (0)