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

fs: workaround quirkly overlayfs listxattr() #43

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

allisonkarlitskaya
Copy link
Collaborator

We use listxattr() with an empty buffer (as documented in the manpage) to query the size of the xattrs that are present. Unfortunately, this "empty buffer" case hits a shortcut in the xattr code in overlayfs which happens before the overlayfs-internal xattrs are filtered out.

Once we perform the read "for real" we hit the filter path and the returned xattrs are smaller than we were expecting.

Let's deal with that by accepting a smaller return value from the second call and truncating the buffer to that length.

Thanks to Shawn Wang [email protected] for the report.

Closes #41

We use listxattr() with an empty buffer (as documented in the manpage)
to query the size of the xattrs that are present.  Unfortunately, this
"empty buffer" case hits a shortcut in the xattr code in overlayfs which
happens before the overlayfs-internal xattrs are filtered out.

Once we perform the read "for real" we hit the filter path and the
returned xattrs are smaller than we were expecting.

Let's deal with that by accepting a smaller return value from the second
call and truncating the buffer to that length.

Thanks to Shawn Wang <[email protected]> for the report.

Closes #41

Signed-off-by: Allison Karlitskaya <[email protected]>
@cgwalters cgwalters merged commit 77b8b96 into main Dec 3, 2024
2 checks passed
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.

unified image build, Error: xattrs changed during read
2 participants