[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140220055115.9cf0cf8200efa03f1136b642@skynet.be>
Date: Thu, 20 Feb 2014 05:51:15 +0800
From: Fabian Frederick <fabf@...net.be>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] fs: xattr: Don't display attributes without read
access
On Tue, 18 Feb 2014 15:16:50 -0800
Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Sun, 16 Feb 2014 20:31:01 +0800 Fabian Frederick <fabf@...net.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?
>
FYI, I just noticed FreeBSD was giving the expected result : no attribute name revealed
without read access ....
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists