Skip to content

compat/linux: return EBADF for O_PATH mmap() and xattr operations#2181

Open
ilovegrape wants to merge 1 commit into
freebsd:mainfrom
ilovegrape:open13-fix-src
Open

compat/linux: return EBADF for O_PATH mmap() and xattr operations#2181
ilovegrape wants to merge 1 commit into
freebsd:mainfrom
ilovegrape:open13-fix-src

Conversation

@ilovegrape
Copy link
Copy Markdown

@ilovegrape ilovegrape commented May 7, 2026

This fixes LTP open13, which expects O_PATH mmap() and fgetxattr()
to fail with EBADF, but FreeBSD returned EACCES for mmap() and
EOPNOTSUPP for fgetxattr().

Apply the same EBADF handling to fsetxattr(), fremovexattr(), and
flistxattr() so the xattr paths stay consistent.

@ilovegrape ilovegrape changed the title compat/linux: return EBADF for LTP open13 O_PATH operations compat/linux: return EBADF for O_PATH mmap() and fgetxattr() May 7, 2026
@lwhsu lwhsu self-assigned this May 7, 2026
This fixes LTP open13, which expects O_PATH mmap() and fgetxattr()
to fail with EBADF, but FreeBSD returned EACCES for mmap() and
EOPNOTSUPP for fgetxattr().

Apply the same EBADF handling to fsetxattr(), fremovexattr(), and
flistxattr() so the xattr paths stay consistent.

Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com>
@ilovegrape ilovegrape changed the title compat/linux: return EBADF for O_PATH mmap() and fgetxattr() compat/linux: return EBADF for O_PATH mmap() and xattr operations May 7, 2026
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