From: Casey Schaufler <casey@schaufler-ca.com>
To: James Morris <jmorris@namei.org>, Ben Hutchings <ben@decadent.org.uk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
770492@bugs.debian.org, Ben Harris <bjh21@cam.ac.uk>,
oss-security@lists.openwall.com,
John Johansen <john.johansen@canonical.com>,
Paul Moore <paul@paul-moore.com>,
Stephen Smalley <sds@tycho.nsa.gov>,
Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [RFC PATCH RESEND] vfs: Move security_inode_killpriv() after permission checks
Date: Tue, 20 Jan 2015 15:32:53 -0800 [thread overview]
Message-ID: <54BEE5A5.5050807@schaufler-ca.com> (raw)
In-Reply-To: <alpine.LRH.2.11.1501211014580.15885@namei.org>
On 1/20/2015 3:17 PM, James Morris wrote:
> On Sat, 17 Jan 2015, Ben Hutchings wrote:
>
>> chown() and write() should clear all privilege attributes on
>> a file - setuid, setgid, setcap and any other extended
>> privilege attributes.
>>
>> However, any attributes beyond setuid and setgid are managed by the
>> LSM and not directly by the filesystem, so they cannot be set along
>> with the other attributes.
>>
>> Currently we call security_inode_killpriv() in notify_change(),
>> but in case of a chown() this is too early - we have not called
>> inode_change_ok() or made any filesystem-specific permission/sanity
>> checks.
>>
>> Add a new function setattr_killpriv() which calls
>> security_inode_killpriv() if necessary, and change the setattr()
>> implementation to call this in each filesystem that supports xattrs.
>> This assumes that extended privilege attributes are always stored in
>> xattrs.
> It'd be useful to get some input from LSM module maintainers on this.
I've already chimed in.
Clearing the Smack label on a file because someone writes to it
makes no sense whatsoever. The same with chown. The Smack label is
attached to the object, which is a container of data, not the data
itself. Smack labels are Mandatory Access Control labels, not Information
labels. If that doesn't mean anything to the reader, check out the
P1003.1e/2c (withdrawn) DRAFT.
The proposed implementation does not correctly handle either
Mandatory Access Control labels or Information labels. The MAC
label is *very different* from the setuid bit.
>
> e.g. doesn't SELinux already handle this via policy directives?
>
>
next prev parent reply other threads:[~2015-01-20 23:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 23:26 [RFC PATCH RESEND] vfs: Move security_inode_killpriv() after permission checks Ben Hutchings
2015-01-20 23:17 ` James Morris
2015-01-20 23:32 ` Casey Schaufler [this message]
2015-01-21 14:03 ` Stephen Smalley
2015-01-21 16:15 ` Casey Schaufler
2015-02-16 19:50 ` Josh Boyer
2015-04-08 21:43 ` Mateusz Guzik
2015-04-13 1:39 ` James Morris
2015-06-03 17:57 ` Mateusz Guzik
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=54BEE5A5.5050807@schaufler-ca.com \
--to=casey@schaufler-ca.com \
--cc=770492@bugs.debian.org \
--cc=ben@decadent.org.uk \
--cc=bjh21@cam.ac.uk \
--cc=jmorris@namei.org \
--cc=john.johansen@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=oss-security@lists.openwall.com \
--cc=paul@paul-moore.com \
--cc=sds@tycho.nsa.gov \
--cc=viro@zeniv.linux.org.uk \
/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.