mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
fuse: limit xattr returned size
Don't let userspace filesystem give bogus values for the size of xattr and xattr list. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
4680a7ee5d
commit
63401ccdb2
@ -79,7 +79,7 @@ ssize_t fuse_getxattr(struct inode *inode, const char *name, void *value,
|
||||
}
|
||||
ret = fuse_simple_request(fc, &args);
|
||||
if (!ret && !size)
|
||||
ret = outarg.size;
|
||||
ret = min_t(ssize_t, outarg.size, XATTR_SIZE_MAX);
|
||||
if (ret == -ENOSYS) {
|
||||
fc->no_getxattr = 1;
|
||||
ret = -EOPNOTSUPP;
|
||||
@ -138,7 +138,7 @@ ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size)
|
||||
}
|
||||
ret = fuse_simple_request(fc, &args);
|
||||
if (!ret && !size)
|
||||
ret = outarg.size;
|
||||
ret = min_t(ssize_t, outarg.size, XATTR_LIST_MAX);
|
||||
if (ret > 0 && size)
|
||||
ret = fuse_verify_xattr_list(list, ret);
|
||||
if (ret == -ENOSYS) {
|
||||
|
Loading…
Reference in New Issue
Block a user