Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176996909
D61006.1793711197.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
826 B
Referenced Files
None
Subscribers
None
D61006.1793711197.diff
View Options
diff --git a/sys/compat/linux/linux_xattr.c b/sys/compat/linux/linux_xattr.c
--- a/sys/compat/linux/linux_xattr.c
+++ b/sys/compat/linux/linux_xattr.c
@@ -153,7 +153,7 @@
}
if (args->size != 0)
- sz = min(LINUX_XATTR_LIST_MAX, args->size);
+ sz = MIN(LINUX_XATTR_LIST_MAX, args->size);
else
sz = LINUX_XATTR_LIST_MAX;
@@ -203,6 +203,13 @@
error = ERANGE;
break;
}
+ KASSERT(keylen + 1 <= rs,
+ ("%s: truncated record", __func__));
+ if (keylen + 1 > rs) {
+ printf("%s: truncated record\n", __func__);
+ error = EIO;
+ goto out;
+ }
++key;
if (args->list != NULL && args->size > 0) {
sprintf(attrname, "%s.%.*s", prefix, keylen, key);
@@ -215,6 +222,7 @@
rs -= (keylen + 1);
}
}
+out:
if (error == 0)
td->td_retval[0] = cnt;
free(data, M_LINUX);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 3, 1:06 PM (8 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41252213
Default Alt Text
D61006.1793711197.diff (826 B)
Attached To
Mode
D61006: linux: do not truncate the listxattr() size
Attached
Detach File
Event Timeline