mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: James Morris <jmorris@namei.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	Joel Becker <joel.becker@oracle.com>,
	Mark Fasheh <mfasheh@suse.com>, Alex Elder <aelder@sgi.com>,
	Chris Mason <chris.mason@oracle.com>,
	a.gruenbacher@computer.org
Subject: Re: [RFC][PATCH 0/2] Correct behavior for listxattr and 'trusted' xattrs
Date: Wed, 03 Mar 2010 08:02:58 -0500	[thread overview]
Message-ID: <1267621378.3436.15.camel@moss-pluto.epoch.ncsc.mil> (raw)
In-Reply-To: <alpine.LRH.2.00.1003021845310.1594@tundra.namei.org>

On Tue, 2010-03-02 at 19:01 +1100, James Morris wrote:
> I noticed that there are differences in the behavior of listxattr(2) for 
> xattrs in the trusted namespace.
> 
> Some filesystems, such as ext[234], require CAP_SYS_ADMIN for this, i.e. 
> trusted xattr names are hidden from unprivileged users.
> 
> I audited the kernel for users of the trusted xattr namespace, and found 
> the following filesystems not checking for CAP_SYS_ADMIN:
> 
>   - jffs2
>   - ocfs2
>   - btrfs
>   - xfs
> 
> I've created patches for jffs2 (tested) and ocfs2 (not tested) to add the 
> check -- see following emails. btrfs and xfs have custom listxattr 
> operations and will need a bit more work to fix.
> 
> I'm not sure what the initial intention was for the behavior, although 
> given that several major filesystems are have been fielded with the 
> CAP_SYS_ADMIN check, it seems most prudent to make this the standard 
> behavior for all filesystems, in case any users are depending on it.
> 
> Thoughts?

Should it be using has_capability_noaudit() rather than capable() so
that merely calling listxattr() on a file that happens to have trusted
xattrs does not set PF_SUPERPRIV on the task and does not trigger an
audit message?

-- 
Stephen Smalley
National Security Agency


  parent reply	other threads:[~2010-03-03 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02  8:01 James Morris
2010-03-02  8:01 ` [PATCH 1/2] jffs2: ensure trusted xattrs are not returned to unprivileged users via listxattr James Morris
2010-03-02  8:02 ` [PATCH 2/2] ocfs2: " James Morris
2010-03-02  9:29   ` Joel Becker
2010-03-02 22:01     ` James Morris
2010-03-02 23:15     ` Serge E. Hallyn
2010-03-02  8:28 ` [RFC][PATCH 0/2] Correct behavior for listxattr and 'trusted' xattrs Andreas Dilger
2010-03-03 13:02 ` Stephen Smalley [this message]
2010-03-10 11:48   ` Andreas Gruenbacher
2010-03-03 14:09 ` Christoph Hellwig
2010-03-10 11:26   ` Andreas Gruenbacher
2010-03-10 11:40 ` Christoph Hellwig
2010-03-10 14:04   ` James Morris

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=1267621378.3436.15.camel@moss-pluto.epoch.ncsc.mil \
    --to=sds@tycho.nsa.gov \
    --cc=a.gruenbacher@computer.org \
    --cc=aelder@sgi.com \
    --cc=chris.mason@oracle.com \
    --cc=dwmw2@infradead.org \
    --cc=jmorris@namei.org \
    --cc=joel.becker@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mfasheh@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®