Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed fuse setxattr body length is not right error #66

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

a-yakov
Copy link

@a-yakov a-yakov commented Feb 14, 2023

Fixed error "body length is not right" when handling any FUSE_SETXATTR request.
Before fix, we checked size of full payload "Name"+"Value", but setxattr.size field specifies only size of "Value" field.
Moved size check procedure down to proper place after payload splitting to "Name" and "Value".
Now we compare setxattr.size field with size of "Value" field.

// setxattr "size" field specifies size of only "Value" part of data
if setxattr_in.size as usize != data.len() {
error!(
"fuse_setxattr_in value field data length is not right, request unique {} setxattr_in.size={} data.len={}", request.unique, setxattr_in.size, data.len());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"fuse_setxattr_in value field data length is not right, request unique {} setxattr_in.size={} data.len={}", request.unique, setxattr_in.size, data.len());
"fuse_setxattr_in value field data length is not right, request unique {} setxattr_in.size={} data.len={}",
request.unique,
setxattr_in.size,
data.len()
);

@Sherlock-Holo Sherlock-Holo merged commit b15cda3 into Sherlock-Holo:master Feb 16, 2023
@Sherlock-Holo
Copy link
Owner

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants