Skip to content

Releases: Stebalien/xattr

Release v1.6.1

21 Sep 02:59

Choose a tag to compare

What's Changed

This release fixes a long-standing bug where we didn't correctly handle the return value of the FreeBSD and NetBSD xattr syscalls.

On Linux (and macOS), the xattr API returns ERANGE if the result doesn't fit in the provided buffer. On FreeBSD (and NetBSD), it returns the number of bytes read even if the syscall fails to read the entire value. This library assumed FreeBSD behaved the same as Linux.

In releases prior to 1.6.0, this issue was unlikely to be encountered in practice (except at scale) because we always checked the size before we read the attribute. It was still incorrect (TOCTOU issue), but it would have required a race with someone changing the extended attributes to trigger the bug.

In 1.6.0 this issue started showing up in testing because we try reading once with a 4KiB buffer before checking the size.

Full Changelog: v1.6.0...v1.6.1

Release v1.6.0

21 Sep 01:33

Choose a tag to compare

What's Changed

Xattr can now read extended attribute values, list extended attributes, etc. in a single syscall instead of 2 as long as the total size is at most 4096 bytes. The downside of this change is that, e.g., if a file has more than 4KiB of extended attributes, listing extended attributes on the file will require 3 syscalls (because the first "optimistic" one will fail).

Full Changelog: v1.5.1...v1.6.0