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

writer: Reject empty xattr names #400

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

cgwalters
Copy link
Contributor

Came out of a related discussion in ostree
ostreedev/ostree#3346 (comment)

Today we faithfully write this, and fsck.erofs doesn't seem to complain...but such a thing makes no sense so we shouldn't support it.

Actually digging in more here...in practice the way xattrs work in Linux at least is they're restricted to starting with one of the standard prefixes like security. or user.; but enforcing/validating that is a whole other thing. For now let's just deny this edge case.

Came out of a related discussion in ostree
ostreedev/ostree#3346 (comment)

Today we faithfully write this, and `fsck.erofs` doesn't seem
to complain...but such a thing makes no sense so we shouldn't
support it.

Actually digging in more here...in practice the way xattrs
work in Linux at least is they're restricted to starting with
one of the standard prefixes like `security.` or `user.`; but
enforcing/validating that is a whole other thing. For now
let's just deny this edge case.

Signed-off-by: Colin Walters <walters@verbum.org>
Copy link
Collaborator

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

Looks good.

Do we try to cover the duplicated case?

@cgwalters
Copy link
Contributor Author

Do we try to cover the duplicated case?

The semantics for that today are that you get last-one-wins. We hit a bug related to this when fuzzing, see 2ef9e9b

We could probably very safely change that to be an error? It'd make sense to me to do so.

@cgwalters cgwalters merged commit c861efa into containers:main Dec 2, 2024
13 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.

2 participants