The Linuxulator currently returns incorrect error codes when some file-descriptor based operations are attempted on an O_PATH descriptor. In particular, LTP open13 expects these operations to fail with EBADF, matching Linux behavior, but FreeBSD currently returns different errors: - mmap() on an O_PATH fd returns EACCES - fgetxattr() on an O_PATH fd returns EOPNOTSUPP The same issue also affects other fd-based xattr operations, which should follow the same O_PATH semantics for consistency: - fsetxattr() - fremovexattr() - flistxattr() This appears to be a Linux compatibility bug rather than a functional limitation. For mmap(), the Linuxulator does not currently reject path_fileops descriptors early with EBADF. For xattr operations, the code reaches the extattr path and returns the underlying FreeBSD error instead of recognizing that an O_PATH fd is not a valid data-access descriptor for these operations. This is only to track the fix for mmap() See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295537
Addressed by https://github.com/freebsd/freebsd-src/pull/2233 according to the comments on https://github.com/freebsd/freebsd-src/pull/2181
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=30c85b7cb9fc52492f2b3a3ae4e0b16ed717c58a commit 30c85b7cb9fc52492f2b3a3ae4e0b16ed717c58a Author: YAO, Xin <mr.yaoxin@outlook.com> AuthorDate: 2026-05-07 06:39:16 +0000 Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> CommitDate: 2026-05-28 19:47:04 +0000 linuxulator: return EBADF for O_PATH mmap() This fixes LTP open13, which expects O_PATH mmap() to fail with EBADF, but FreeBSD returned EACCES. Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com> PR: 295571 Reviewed by: kib Pull-Request: https://github.com/freebsd/freebsd-src/pull/2233 sys/compat/linux/linux_mmap.c | 4 ++++ 1 file changed, 4 insertions(+)
Waiting on PR2181-2182