HomeFreeBSD

linuxulator: Add linux_extattr_get_vp() for atomic getxattr

Description

linuxulator: Add linux_extattr_get_vp() for atomic getxattr

Move the atomic size-probe-and-read logic into a new
linux_extattr_get_vp() function in linux_xattr.c instead of
modifying the generic extattr_get_vp() in vfs_extattr.c.
This keeps Linux-specific getxattr semantics (ERANGE on
too-small buffer, EOPNOTSUPP to ENOATTR mapping)
self-contained within the linuxulator.

The function probes the attribute size and reads the data
under a single vnode lock, preventing a TOCTOU race between
the size probe and data read.

Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com>
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/2263

Details

Provenance
mr.yaoxin_outlook.comAuthored on Jun 29 2026, 1:55 AM
pouriaCommitted on Jul 1 2026, 8:38 AM
Parents
rG2c905456312b: linuxulator: Fix O_PATH file descriptors errno for f*xattr(2)
Branches
Unknown
Tags
Unknown