Commit 7f7b822d09c5 for kernel
commit 7f7b822d09c5590defcc61a37ffbd5a3533ed518
Author: Miklos Szeredi <mszeredi@redhat.com>
Date: Fri Nov 20 11:33:01 2026 +0100
fuse: limit name size in listxattr
Limit the size of names to XATTR_NAME_MAX. Return -EIO to the listxattr()
caller if the server exceeds this limit.
Fixes: 92a8780e1136 ("[PATCH] FUSE - extended attribute operations")
Cc: stable@vger.kernel.org
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
diff --git a/fs/fuse/xattr.c b/fs/fuse/xattr.c
index 53e3c5e6fff0..02f780e7426d 100644
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c
@@ -94,7 +94,7 @@ static int fuse_verify_xattr_list(char *list, size_t size)
while (size) {
size_t thislen = strnlen(list, size);
- if (!thislen || thislen == size)
+ if (!thislen || thislen == size || thislen > XATTR_NAME_MAX)
return -EIO;
size -= thislen + 1;