Page MenuHomeFreeBSD

D61006.1793720850.diff
No OneTemporary

Authored By
Unknown
Size
826 B
Referenced Files
None
Subscribers
None

D61006.1793720850.diff

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

Mime Type
text/plain
Expires
Tue, Nov 3, 3:47 PM (11 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41252213
Default Alt Text
D61006.1793720850.diff (826 B)

Event Timeline