summaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorEdward Adam Davis <eadavis@qq.com>2023-12-30 17:00:03 +0800
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-01-29 12:05:08 +0300
commit731ab1f9828800df871c5a7ab9ffe965317d3f15 (patch)
tree1967b71ee0bd915d2eabbd4e1bad9cd373eeab6d /fs/ntfs3
parentb2dd7b953c25ffd5912dda17e980e7168bebcf6c (diff)
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>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/xattr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 071356d096d8..53e7d1fa036a 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -219,6 +219,9 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,
if (!ea->name_len)
break;
+ if (ea->name_len > ea_size)
+ break;
+
if (buffer) {
/* Check if we can use field ea->name */
if (off + ea_size > size)