compat/linux: return EBADF for O_PATH mmap() and xattr operations#2181
compat/linux: return EBADF for O_PATH mmap() and xattr operations#2181ilovegrape wants to merge 1 commit into
Conversation
8ec198c to
63c88bc
Compare
|
I suggest to open a bug report in https://bugs.freebsd.org with what is failing and then add a tag with |
I don't have an account, and I need to request one... @ricardobranco777 How do you think if I create a patch in Phabricator? |
You can use any e-mail to create an account in Bugzilla.
I dunno. Haven't used it yet. |
I requested the account once again according to the process just now |
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. PR: 295537 Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com>
63c88bc to
a8c6bd8
Compare
|
Bug fired with commit msg updated, any further comments? |
Thank you. Including a minimal reproducer also helps. :) |
|
Updated with the comments below on the PR case.
|
|
The description makes it seem like it would be enough to convert EOPNOTSUPP to EBADF, but the patch itself is a bit more elaborate. Is there any reason for that? |
The patch is only intended to return EBADF for O_PATH file descriptors, not to rewrite all EOPNOTSUPP errors. |
| error = getvnode(td, fd, rights, &fp); | ||
| if (error != 0) | ||
| return (error); | ||
| fdrop(fp, td); |
There was a problem hiding this comment.
Good point, I need to think a little deeply into it...
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.