Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2026 01:37:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 295537] linuxulator: O_PATH file descriptors return wrong errno for mmap(2) and f*xattr(2)
Message-ID:  <bug-295537-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295537

            Bug ID: 295537
           Summary: linuxulator: O_PATH file descriptors return wrong
                    errno for mmap(2) and f*xattr(2)
           Product: Base System
           Version: 15.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: mr.yaoxin@outlook.com

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 addressed by
https://github.com/freebsd/freebsd-src/pull/2181

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-295537-227>