linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] fs: xattr: Don't display attributes without read access
Date: Tue, 18 Feb 2014 15:16:50 -0800	[thread overview]
Message-ID: <20140218151650.02fb2d6034deb2d3d11ccc7a@linux-foundation.org> (raw)
In-Reply-To: <20140216203101.bf432a8b7b40703197a91462@skynet.be>

On Sun, 16 Feb 2014 20:31:01 +0800 Fabian Frederick <fabf@skynet.be> wrote:

> Any user can display extented attribute names without read
> access.
> 
> eg: attr -l <filename>
> 
> This patch checks inode_permission in listxattr common
> function before executing vfs_listxattr.
> 
> ...
>
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -543,6 +543,10 @@ listxattr(struct dentry *d, char __user *list, size_t size)
>  	char *klist = NULL;
>  	char *vlist = NULL;	/* If non-NULL, we used vmalloc() */
>  
> +	error = inode_permission(d->d_inode, MAY_READ);
> +	if (error)
> +		return error;
> +
>  	if (size) {
>  		if (size > XATTR_LIST_MAX)
>  			size = XATTR_LIST_MAX;

erk.  Doesn't this mean that if existing userspace is relying on the
current behaviour, this patch will cause breakage?

  reply	other threads:[~2014-02-18 23:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-16 12:31 [PATCH 1/1] fs: xattr: Don't display attributes without read access Fabian Frederick
2014-02-18 23:16 ` Andrew Morton [this message]
2014-02-18 22:43   ` Fabian Frederick
2014-02-19 21:51   ` Fabian Frederick

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=20140218151650.02fb2d6034deb2d3d11ccc7a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).