From: "Pali Rohár" <pali@kernel.org>
To: Paulo Alcantara <pc@manguebit.com>
Cc: Steve French <smfrench@gmail.com>, linux-cifs@vger.kernel.org
Subject: Re: Regression with getcifsacl(1) in v6.14-rc1
Date: Wed, 12 Feb 2025 23:43:30 +0100 [thread overview]
Message-ID: <20250212224330.g7wmpd225fripkit@pali> (raw)
In-Reply-To: <92b554876923f730500a4dc734ef8e77@manguebit.com>
On Wednesday 12 February 2025 19:19:00 Paulo Alcantara wrote:
> Pali Rohár <pali@kernel.org> writes:
>
> > On Wednesday 12 February 2025 17:49:31 Paulo Alcantara wrote:
> >> Steve,
> >>
> >> The commit 438e2116d7bd ("cifs: Change translation of
> >> STATUS_PRIVILEGE_NOT_HELD to -EPERM") regressed getcifsacl(1) because it
> >> expects -EIO to be returned from getxattr(2) when the client can't read
> >> system.cifs_ntsd_full attribute and then fall back to system.cifs_acl
> >> attribute. Either -EIO or -EPERM is wrong for getxattr(2), but that's a
> >> different problem, though.
> >>
> >> Reproduced against samba-4.22 server.
> >
> > That is bad. I can prepare a fix for cifs.ko getxattr syscall to
> > translate -EPERM to -EIO. This will ensure that getcifsacl will work as
> > before as it would still see -EIO error.
>
> Sounds good.
>
> > But as discussed before, we need to distinguish between
> > privilege/permission error and other generic errors (access/io).
> > So I think that we need 438e2116d7bd commit.
>
> OK.
>
> > Based on linux-fsdevel discussion it is a good idea to distinguish
> > between errors by mapping status codes to appropriate posix errno, and
> > then updating linux syscall manpages.
>
> Either way, we shouldn't be leaking -EIO or -EPERM to userland from
> getxattr(2). By looking at the man pages, -ENODATA seems to be the
> appropriate error to return instead.
It looks like there are missing error codes for getxattr. Because any
path based syscall can return -EACCES if trying to open path to which
calling process does not have access.
And EACCES is not mentioned nor documented in getxattr(2). Same applies
for listxattr(2). Now I have tried listxattr() and it really returns
EACCES for /root/file called by nobody.
-EIO is generic I/O error. And I think that this error code could be
returned by any I/O syscall when unknown I/O error occurs.
Returning -ENODATA for generic or unknown I/O error is a bad idea
because ENODATA (= ENOATTR) has already specific meaning when attribute
does not exists at all (or process does not have access to it).
For me it makes sense to return -EIO and -EPERM by those syscalls. But
for getxattr() we cannot do it due that backward compatibility needed by
getcifsacl application.
next prev parent reply other threads:[~2025-02-12 22:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 20:49 Regression with getcifsacl(1) in v6.14-rc1 Paulo Alcantara
2025-02-12 22:07 ` Pali Rohár
2025-02-12 22:19 ` Paulo Alcantara
2025-02-12 22:43 ` Pali Rohár [this message]
2025-02-12 22:58 ` Paulo Alcantara
2025-02-12 23:47 ` Steve French
2025-02-13 0:02 ` Pali Rohár
2025-02-13 2:46 ` Steve French
2025-02-13 12:08 ` Paulo Alcantara
2025-02-13 18:46 ` Pali Rohár
2025-02-13 18:41 ` Pali Rohár
2025-02-13 18:52 ` Steve French
2025-03-23 10:36 ` Pali Rohár
2025-03-24 0:36 ` Paulo Alcantara
2025-03-24 8:23 ` Pali Rohár
2025-03-24 15:33 ` Steve French
2025-03-24 17:07 ` Pali Rohár
2025-03-24 17:17 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250212224330.g7wmpd225fripkit@pali \
--to=pali@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.com \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.