lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 5 Sep 2023 11:36:51 +0000
From:   Ondrej Valousek <ondrej.valousek.xm@...esas.com>
To:     Jeff Layton <jlayton@...nel.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>
CC:     "trondmy@...merspace.com" <trondmy@...merspace.com>,
        "eggert@...ucla.edu" <eggert@...ucla.edu>,
        "bruno@...sp.org" <bruno@...sp.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr

Ok, filed BZ for it, will see:
https://bugzilla.redhat.com/show_bug.cgi?id=2237410

-----Original Message-----
From: Jeff Layton <jlayton@...nel.org>
Sent: Dienstag, 5. September 2023 12:51
To: Ondrej Valousek <ondrej.valousek.xm@...esas.com>; Alexander Viro <viro@...iv.linux.org.uk>; Christian Brauner <brauner@...nel.org>
Cc: trondmy@...merspace.com; eggert@...ucla.edu; bruno@...sp.org; linux-fsdevel@...r.kernel.org; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr

On Mon, 2023-09-04 at 20:36 +0000, Ondrej Valousek wrote:
> Hi Jeff,
>
> I can confirm that with rawhide kernel 6.5 the error is gone, i.e.
>
> Listxattr() shows only "system.nfs4_acl" attribute on NFSv4
> filesystem,
>
> Problem is, that (on the same kernel)
> getxattr(name,XATTR_NAME_POSIX_ACL_ACCESS, 0,0) Sets errno to ENODATA where "name" is file on NFSv4.
>
> This is different behavior to the previous versions, i.e. on RHEL8 getxattr() sets errno to ENOTSUP in the same scenario - which is what I'd expect more.
>
> Is the change of the getxattr() behavior expected or not?
>
> Thanks,
> Ondrej
>

I'd say not. I've been working through xfstests failures on NFS and didn't realize that this was a regression, and posted this fstests patch
recently:

    https://lore.kernel.org/fstests/20230830-fixes-v4-1-88d7b8572aa3@kernel.org/

It would be nice if getxattr were also fixed here.

Cheers,
Jeff

> -----Original Message-----
> From: Jeff Layton <jlayton@...nel.org>
> Sent: Dienstag, 16. Mai 2023 14:47
> To: Alexander Viro <viro@...iv.linux.org.uk>; Christian Brauner
> <brauner@...nel.org>
> Cc: trondmy@...merspace.com; eggert@...ucla.edu; bruno@...sp.org;
> Ondrej Valousek <ondrej.valousek.xm@...esas.com>;
> linux-fsdevel@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [PATCH] fs: don't call posix_acl_listxattr in
> generic_listxattr
>
> Commit f2620f166e2a caused the kernel to start emitting POSIX ACL xattrs for NFSv4 inodes, which it doesn't support. The only other user of generic_listxattr is HFS (classic) and it doesn't support POSIX ACLs either.
>
> Fixes: f2620f166e2a xattr: simplify listxattr helpers
> Reported-by: Ondrej Valousek <ondrej.valousek.xm@...esas.com>
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
> ---
>  fs/xattr.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index fcf67d80d7f9..e7bbb7f57557 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -985,9 +985,16 @@ int xattr_list_one(char **buffer, ssize_t *remaining_size, const char *name)
>       return 0;
>  }
>
> -/*
> +/**
> + * generic_listxattr - run through a dentry's xattr list() operations
> + * @dentry: dentry to list the xattrs
> + * @buffer: result buffer
> + * @buffer_size: size of @buffer
> + *
>   * Combine the results of the list() operation from every
> xattr_handler in the
> - * list.
> + * xattr_handler stack.
> + *
> + * Note that this will not include the entries for POSIX ACLs.
>   */
>  ssize_t
>  generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) @@ -996,10 +1003,6 @@ generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
>       ssize_t remaining_size = buffer_size;
>       int err = 0;
>
> -     err = posix_acl_listxattr(d_inode(dentry), &buffer, &remaining_size);
> -     if (err)
> -             return err;
> -
>       for_each_xattr_handler(handlers, handler) {
>               if (!handler->name || (handler->list && !handler->list(dentry)))
>                       continue;
> --
> 2.40.1
>

--
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ